Skip to content
What an agent actually is

01.03 · Concept

What the model actually sees each turn

Reconstruct the exact payload sent on turn three of a conversation with two tool calls.

No video curated for this lesson yet

This lesson is written, ordered and part of the path - the video slot is the only thing still open. We are working through Agents & MCP lesson by lesson; 56 of 60 have their video so far.

The written notes below cover this idea in full - you lose nothing by reading instead of watching.

A turn payload is the actual request the model receives: retained messages, tool definitions, tool-call requests, tool results, and any copied context. Debugging agent behaviour means reconstructing that payload in order, because MCP calls, host state, and trace logs are not automatically the same thing as model-visible input.

What this lesson answers

  • what does the model see after tool calls
  • how are MCP tool results shown to the model
  • why did my agent ignore a tool result

Notes

Turn Payload — A turn payload exists to define the exact messages, tool schemas, tool results, and context sent to the model; without it, you cannot explain why turn three chose the wrong tool, ignored a prior result, or exceeded the context window.

Key Concepts: - In the OpenAI Agents SDK, a model call is reconstructed from `input` messages plus registered `tools`; turn 3 after two tool calls must include the user/developer messages, both assistant tool-call requests, and both tool-result messages in order.

Common questions

Does an MCP tools/call result automatically reach the model?
No. MCP returns the result to the host application. The model only sees that result if the host copies it into the next model request in the right message or content-block form. A successful tool call can appear in server logs while being completely absent from the next model payload.
What should be present in the payload after two tool calls?
The next model request should contain the retained user and developer messages, both assistant tool-call requests, both corresponding tool-result messages, and the registered tool schemas that remain available. Order matters, because the model infers causality from the sequence of messages it is given.
Why can adding one MCP server greatly increase input tokens?
Tool schemas are sent as part of the model input when tools are available. If an MCP server exposes many tools, or tools with large JSON schemas, that schema text can be resent alongside prior conversation history. The cost appears in input tokens before the new user message is even considered.