Files
coder/agent/x
Ethan e0e6accdd9 feat: return raw MCP results from workspace MCP tools (#31385)
Part of [CODAGT-1430](https://linear.app/codercom/issue/CODAGT-1430).
Stacked on #31384.

Workspace MCP tool results go through the agent's `convertResult`, which
turns an embedded resource into a `[embedded resource: ...]` string and
drops structured content, so a PDF from a workspace MCP server never
reaches the model. Remote MCP tools already go through `mcpclient`'s
converter, which keeps both.

When a call-tool request sets `include_result`, the agent now returns
the MCP `CallToolResult` as-is in `Result` and leaves `Content` empty.
chattool always sets it and converts the result with
`mcpclient.ConvertCallResult`, so workspace and remote MCP tools share
one converter. Older agents ignore the flag and send the legacy
`Content`, which we adapt to MCP content and pass to the same converter.
The workspace MCP docs get a short Tool results section too.
2026-11-11 00:06:41 +11:00
..