Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sdk/arch/mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ flowchart TB
6. **Observation Creation:** Wrap in `MCPToolObservation`
7. **Error Handling:** Catch exceptions, return error observations

MCP tools can return two kinds of data beyond their text and image content:
`structuredContent`, machine-readable result data for clients that render or
process it, and result `_meta`, protocol metadata about the call.
`MCPToolObservation` preserves both in the `structured_content` and
`result_meta` fields. They serialize with the observation, so API and websocket
clients receive them, but they are not sent to the model.

Masking follows the same rules as text output: when a conversation is attached,
registered secrets inside these fields are replaced before the observation is
persisted or delivered, walking nested keys and values. If a field cannot be
masked safely, it is dropped rather than delivered unmasked.

### MCPToolExecutor

Executors bridge SDK actions to MCP calls:
Expand Down
Loading