-
Notifications
You must be signed in to change notification settings - Fork 876
Description
Is your feature request related to a problem? Please describe.
I'm always sad when using MCP tools with enum parameters because the Inspector renders them as text input fields despite having the valid options available in the Zod schema. Users must manually type values like "some very long value because I can't provide my actual example because I have a mortgage to pay" without seeing the available options, leading to typos and validation errors. The valid options are only visible in the description text, requiring users to read carefully and type precisely.
Describe the solution you'd like
When the Inspector detects a z.enum()
schema for a tool parameter, it should render a <select>
dropdown instead of a text input. The dropdown would populate its options from the enum values already available in the Zod schema. For example, z.enum(["some option one", "some option two", "some option three"])
would render as a dropdown with those three options, with any default value pre-selected (possibly even just first in array).
Describe alternatives you've considered
- Autocomplete text input: Add typeahead suggestions based on enum values, but this still requires typing
- Radio buttons: For small enums (< say 5 options), but doesn't scale well for larger lists
- Better inline documentation: Show valid options more prominently near the input, but doesn't prevent typos
A dropdown remains the most intuitive UI pattern for selecting from predefined options and supports me being as lazy as possible.
Additional context
Since the Inspector already uses Zod for validation and has access to the enum values via the schema, implementing this should be straightforward. The type information is already there - it just needs to be used for rendering.
Example schema that should trigger dropdown rendering:
z.enum(["option one", "option two", "option three", "option four", "option five", "option six"])
.optional()
.default("option one")
This would benefit all MCP servers using enum parameters, improving user experience and reducing input errors.
Thank you 🤖💕