Skip to content

[Docs] mcp input constraints lack clarity #2722

Open
@markgoho

Description

@markgoho

Is your report related to a problem? Please describe.
Initial MCP docs suggest there are some constraints on MCP prompts:

MCP prompts are only able to take string parameters, so inputs to schemas must be objects with only string property values.

But the example given shows:

ai.defineTool(
  {
    name: 'add',
    description: 'add two numbers together',
    // object with numbers, not strings
    inputSchema: z.object({ a: z.number(), b: z.number() }),
    outputSchema: z.number(),
  },
  async ({ a, b }) => {
    return a + b;
  }
);

Is your report related to a suggestion/improvement? Please describe.
Looking for clarity on the constraint.

Additional context
Add any other context or screenshots about the request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions