genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[Docs] mcp input constraints lack clarity

Open markgoho opened this issue 7 months ago • 0 comments

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.

markgoho avatar Apr 08 '25 17:04 markgoho