The system prompt sets standing instructions for a conversation, the user prompt carries each request, and tool definitions describe functions the model may ask your code to run. All reach the model as tokens in one sequence, wrapped in role markers, and models are trained, imperfectly, to rank system instructions above user text.
Example: you define get_weather with a JSON schema for city and date, and a user asks about an umbrella for Oslo tomorrow. The model fetches nothing: it returns a structured call, get_weather with city "Oslo", and stops. Your code calls a weather API, appends the result, 6 mm of rain, as a tool-result message and calls the model again to answer. Tool definitions are input tokens on both calls.
Interviewers then probe trust. A system prompt is not a security boundary: users can often extract it, so keep secrets out and enforce permissions in the code that runs tools. Tool results can carry injected instructions, which is why "The Instruction Hierarchy" (Wallace et al., 2024) trains models to rank system over user over tool output.