Skip to content

Support Zod schema with Elicitation? #662

Closed

Description

@kentcdodds

Is your feature request related to a problem? Please describe.

From the SDK docs:

const result = await server.server.elicitInput({
  message: `No tables available at ${restaurant} on ${date}. Would you like to check alternative dates?`,
  requestedSchema: {
    type: "object",
    properties: {
      checkAlternatives: {
        type: "boolean",
        title: "Check alternative dates",
        description: "Would you like me to check other dates?"
      },
      flexibleDates: {
        type: "string",
        title: "Date flexibility",
        description: "How flexible are your dates?",
        enum: ["next_day", "same_week", "next_week"],
        enumNames: ["Next day", "Same week", "Next week"]
      }
    },
    required: ["checkAlternatives"]
  }
});

Feels verbose when all other schemas can use zod.

Describe the solution you'd like

I would like a way to use zod to configure elicitations.

Describe alternatives you've considered

Status quo. I could even make (or find) a tool to generate the schema based on a zod schema.

Additional context

I'm not sure there's a good way to have a title with a zod schema, so maybe we'd do similar to the completable API we have for prompts:

titled('The title', z.string().describe('the description')

Activity

  1. added
    enhancementRequest for a new feature that's not currently supported
    on Jun 19, 2025
  2. added
    ready for workEnough information for someone to start working on
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    v2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
    on Dec 16, 2025
  3. self-assigned this
    on Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Moderate issues affecting some users, edge cases, potentially valuable featureenhancementRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions