A tool call asks for an action; a tool result delivers the answer. After your harness runs the requested tool, it packages the output and adds it to the conversation. On the next request the model reads that result and continues, now knowing what the file contained or whether the command passed.
Linking result to call
A tool result references the id of the call it answers, so the model can match output to request even when several tools ran at once:
// Sent back to the model after running the tool
{
type: 'tool_result',
tool_use_id: 'toolu_01A2b3',
content: 'export function main() { /* ... */ }',
}That paired structure, a call with an id and a result that quotes it, is the backbone of the agent loop.
It lands back in the context window
The result is not free. Whatever you feed back, a file, a stack trace, a directory listing, is now text in the context window, counted in tokens and carried for the rest of the session. This is why dumping a 5,000-line file as a tool result can quietly wreck an agent: it crowds out everything else. Good tools return focused output, and good harnesses trim or summarise large results rather than pasting them whole.
Related terms
Tool
A tool is a named action, with a typed input schema, that a model is allowed to call. Tools are how a model that can only produce text gets to actually do things: read a file, run a command, search the web.
Read definition →Tool call
A tool call is the model’s request to use a tool: it names the tool and supplies the arguments, then pauses. It has not run anything. Your harness is what actually executes the action.
Read definition →Agent
An agent is a language model wrapped in a loop that lets it call tools, read the results, and decide what to do next. The model supplies the judgement; the loop and the tools give it hands.
Read definition →