MCP Shipyard
← Rules catalog

Closed-set MCP parameters (sort, format, status) should use enum or list their values

String parameters like sort, format or status with no enum or listed values make models guess and trigger validation errors.

minorschema.enum-missingGeneral, ChatGPT

Declare the allowed values for closed-set string parameters. The rule schema.enum-missing is a minor finding for general clients and ChatGPT, reported as a warning. It checks string parameters named sort, sort_by, order, order_by, direction, status, format, league, sport, period, interval, granularity, unit, stat or metric.

What you see

  • A scan reports No allowed values for: sort, status.
  • The model guesses "newest" when the server only accepts "created_desc", and the call fails with a validation error.
  • The rule passes when the parameter has enum or const, or when the parameter or tool description lists the values ("one of", "e.g.", "such as", quoted options).

Why it happens

The handler validates against a set of constants, but the schema says only type: string. Models read the schema and the descriptions, not your source code.

The MCP tools specification says servers MUST validate tool inputs and that input validation errors should be returned as tool execution errors with actionable feedback. A schema that states the allowed values prevents most of those errors in the first place. OpenAI's server guide shows enums in its examples (a status of active or archived), though it does not discuss them in prose.

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
 | jq -r '.result.tools[] | .name as $n | .inputSchema.properties // {} | to_entries[] | select(.key|test("^(sort|sort_by|order|order_by|direction|status|format|period|interval|unit|metric)$")) | select(.value.enum == null) | "\($n).\(.key)"'

Fix

"sort": { "type": "string", "enum": ["created_desc", "created_asc", "total_desc"], "default": "created_desc",
          "description": "Sort order for the order list." }
  1. Add the enum and a default.
  2. If the set is large or changes often, list it in a dedicated tool (list_carriers) and say so in the parameter description.
  3. Make the validation error name the valid values.

Verify

The jq command prints nothing, and a call with a bad value returns a message that lists the valid ones. Re-scan.

Which clients care

General and ChatGPT, per the rule.

Source

MCP tools specification: https://modelcontextprotocol.io/specification/2026-07-28/server/tools

OpenAI MCP server guide: https://developers.openai.com/plugins/build/mcp-server

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server