MCP Shipyard
← Rules catalog

MCP page-size parameters without a maximum: cap limit, per_page and count

A limit parameter with no maximum lets one call return a huge result. Add maximum and default so responses stay proportionate.

minorschema.limit-unboundedGeneral, Claude

Put a ceiling on page-size style parameters. The rule schema.limit-unbounded is a minor finding for general clients and Claude, reported as a warning. It checks integer or number parameters named limit, page_size, per_page, count, top, n, max_results, take or size.

What you see

  • A scan reports No maximum on: limit.
  • A single call can return thousands of rows, which fills the model's context and slows the reply.
  • A stated cap in prose also satisfies the rule: "1 to 50", "at most 100", "max 25" in the parameter or tool description.

Why it happens

limit: integer is the obvious schema. The server may clamp it internally, but nothing in the schema says so, so the model asks for 10,000.

Claude's directory policy 5.B says MCP servers "must be frugal with their use of tokens". Claude's review criteria say not to return a full database dump when a summary was requested. Oversized responses are a separate failure that reviewers also look for.

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("^(limit|page_?size|per_?page|count|top|n|max_?results|take|size)$")) | select(.value.maximum == null) | "\($n).\(.key)"'

Fix

"limit": { "type": "integer", "minimum": 1, "maximum": 50, "default": 20, "description": "Orders to return, 1 to 50. Use page for more." }
  1. Add minimum, maximum and default to the schema.
  2. Enforce the same ceiling in the handler and return a clear error for larger values.
  3. Offer pagination (page or a cursor) and return a has_more flag.
  4. Keep default results compact: ids, status and key fields, with a separate detail tool.

Verify

The jq command prints nothing, a call with limit above the maximum returns a helpful error, and the re-scan passes.

Which clients care

General and Claude, per the rule.

Source

Claude directory policy: https://support.claude.com/en/articles/13145358-anthropic-software-directory-policy

Claude review criteria: https://claude.com/docs/connectors/building/review-criteria

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