Skip to content

Python: MCP tools with complex input schema (array) #3013

@kkutrowski

Description

@kkutrowski

It looks like agents don't see entire tools input schema. I have a tool which has in its input schema an array of objects and agents don't see the content of objects and therefore it hallucinates it. I think it might be similar issue which I fixed in autogen: microsoft/autogen#6991

Example tool input schema:
const CreateSalesOrderInputSchema = z.object({
contract: z.string().describe("Reference contract number"),
items: z.array(SalesOrderItemSchema).describe("Sales order line items")
});

const SalesOrderItemSchema = z.object({
customerMaterialNumber: z.string().optional().describe("Customer's material number. "),
quantity: z.number().describe("Order quantity"),
unitOfMeasure: z.string().describe("Unit of measure (e.g., 'ST', 'KG', 'TO')")
});

I asked agent to show me the input schema for the tool and I see:
{ "contract": "str", "items": "list[dict]" }

Release: python-1.0.0b251218

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions