Vivian Fang
7bbe3b6011
Add output_schema to code mode render (#17210)
This updates code-mode tool rendering so MCP tools can surface
structured output types from their `outputSchema`.
What changed:
- Detect MCP tool-call result wrappers from the output schema shape
instead of relying on tool-name parsing or provenance flags.
- Render shared TypeScript aliases once for MCP tool results
(`CallToolResult`, `ContentBlock`, etc.) so multiple MCP tool
declarations stay compact.
- Type `structuredContent` from the tool definition's `outputSchema`
instead of rendering it as `unknown`.
- Update the shared MCP aliases to match the MCP draft `CallToolResult`
schema more closely.
Example:
- Before: `declare const tools: { mcp__rmcp__echo(args: { env_var?:
string; message: string; }): Promise<{ _meta?: unknown; content:
Array<unknown>; isError?: boolean; structuredContent?: unknown; }>; };`
- After: `declare const tools: { mcp__rmcp__echo(args: { env_var?:
string; message: string; }): Promise<CallToolResult<{ echo: string; env:
string | null; }>>; };`
2026-04-10 11:41:44 +00:00
..
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 08:42:18 -07:00
2026-04-08 08:42:18 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-10 11:41:44 +00:00
2026-04-10 11:41:44 +00:00
2026-04-08 01:07:55 -07:00
2026-03-27 12:02:55 -07:00
2026-04-01 13:21:50 -07:00
2026-04-01 13:21:50 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-10 11:41:44 +00:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-10 11:41:44 +00:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-01 14:06:04 -07:00
2026-04-08 11:22:39 -07:00
2026-04-08 11:22:39 -07:00
2026-04-08 01:07:55 -07:00
2026-03-27 12:02:55 -07:00
2026-04-09 18:15:10 -07:00
2026-04-09 18:15:10 -07:00
2026-04-10 11:41:44 +00:00
2026-04-09 13:34:52 -07:00
2026-04-10 11:41:44 +00:00
2026-04-08 01:07:55 -07:00
2026-04-01 19:31:24 -07:00
2026-04-01 20:49:15 -07:00
2026-04-01 20:49:15 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00
2026-04-08 01:07:55 -07:00