MCP Shipyard
← Rules catalog

MCP tool name invalid characters: allowed charset is A-Z a-z 0-9 _ - .

MCP tool names should use only letters, digits, underscore, hyphen and dot. Find names with spaces, slashes or colons using jq, and rename them.

majornaming.charsetGeneral, Claude, ChatGPT

Use only letters, digits, underscore, hyphen and dot in tool names, with no spaces or commas, for example get_order_status. The scanner reports naming.charset as major and flags every tool whose name breaks that set.

What you see

  • A scan reports naming.charset: Name "Get Order" has characters outside A-Z a-z 0-9 _ - .
  • A client or model API refusing the tool list because of a name. The exact error text varies by client and is not verified here.
  • Some model APIs apply their own tool name pattern, often stricter than the MCP spec. Check the API you call for the exact pattern; this page does not verify it.

Why it happens

Names come from labels, file paths or class names: Orders/Get, get order, orders:get, Orders.Get Status. The MCP tools specification (2025-11-25) says names should use only ASCII letters, digits, underscore, hyphen and dot, should not contain spaces, commas or other special characters, should be unique within a server and are case-sensitive. These are SHOULD-level statements, which is why this rule is major rather than a blocker.

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 | select(test("^[A-Za-z0-9_.-]+$") | not)'

Any line printed fails the rule. Strip an SSE data: prefix first if the server streams responses.

Fix

Rename each tool and update handlers, tests and docs.

BeforeAfter
Get Orderget_order
orders/listlist_orders
orders:cancelcancel_order
Track Shipment (v2)track_shipment

Prefer underscores or hyphens, one style across the server. Dots work under this rule, but some model APIs do not accept them; if you target several clients, avoid dots. Keep names unique after renaming (naming.length covers the 64-character limit for Claude).

Verify

Re-run the jq filter and expect no output. Call each renamed tool once from the client you target.

Which clients care

The rule tags general, Claude and ChatGPT. Any client that forwards names to a model API can fail on characters that API rejects.

Source

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

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