MCP adapter: nested JSON/Zod schema fields not surfaced to agents (arrays/objects ignored) #6982
Unanswered
kkutrowski
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
AutoGen agents don’t see nested fields from an MCP tool’s inputSchema. Only top-level scalars are surfaced, so arrays/objects appear “missing.”
Example tool:
`import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
export function registerTodoCreate(server: McpServer) {
const itemShape = {
text: z.string(),
done: z.boolean().optional(),
} satisfies z.ZodRawShape;
const toolInput = {
listName: z.string(),
items: z.array(z.object(itemShape)).min(1),
} satisfies z.ZodRawShape;
server.registerTool(
"todo_create",
{
title: "Create a TODO list",
description: "Creates a TODO list with items.",
inputSchema: toolInput,
},
async (args) => ({ content: [{ type: "text", text: JSON.stringify(args) }] })
);
}`
Expected agent input:
{ "listName": "Weekend chores", "items": [ { "text": "Buy milk" }, { "text": "Mow lawn", "done": false } ] }
Actual: agent only lists listName and says items doesn’t exist.
Env: AutoGen 0.7.4 (Python), MCP server @modelcontextprotocol/sdk (Node).
I tried wrapping under payload: z.object(...) but I had the same result.
Questions
Is this a known limitation/bug in the AutoGen MCP adapter?
Is there a recommended pattern to support nested inputs without stringifying?
Beta Was this translation helpful? Give feedback.
All reactions