CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

trysac/mcp-schema-lint

Lint a saved MCP tools/list JSON file for invalid tool names, weak descriptions, untyped input schema parameters and token bloat. Use when reviewing, auditing or fixing MCP tool definitions before release or in CI.

Quality

97%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

SKILL.md

name:
mcp-schema-lint
description:
Lint a saved MCP tools/list JSON file for invalid tool names, weak descriptions, untyped input schema parameters and token bloat. Use when reviewing, auditing or fixing MCP tool definitions before release or in CI.

mcp-schema-lint

Check MCP tool definitions against ten rules and fix what is reported. The check reads a local JSON file only. It never connects to a server and needs no Node.js or npm install: Python 3.8 or newer is enough.

When to use

  • The user asks to review, audit or clean up MCP tool definitions or a tools/list result.
  • A server's tools are picked wrongly by agents, rejected by a client for their names, or cost too much context.
  • Before publishing an MCP server, or when adding a lint step to CI.

Workflow

  1. Get the definitions as JSON: either { "tools": [...] } (a tools/list result) or a bare array of tool objects. If the user only has source code, write the tool list to a file first. Do not contact the server yourself.
  2. Run the linter from this skill folder: python3 scripts/lint_tools.py FILE Options: --format json, --strict (warnings also fail), --config FILE, --max-tool-tokens N.
  3. Read each finding: severity ruleId tool path message. The path is an RFC 6901 JSON Pointer into the file. Fix errors first, then warnings. The rule details are in the references below.
  4. Edit the tool definitions (names, descriptions, inputSchema), then run the linter again until it reports 0 errors.
  5. Report what changed: findings before and after, and the token estimate before and after.

Exit codes: 0 no errors, 1 errors (or warnings with --strict), 2 unreadable file, invalid JSON, invalid configuration or usage error.

Rules at a glance

IdDefaultChecks
name-formaterrorName is 1-128 characters of A-Z a-z 0-9 _ - .
name-portabilitywarningName also fits ^[a-zA-Z0-9_-]{1,64}$ (stricter model APIs)
name-duplicateerrorNames are unique within the list
description-missingerrorEvery tool has a non-blank description
description-qualitywarningNot shorter than 20 characters, not the tool name, not a generic phrase
schema-rooterrorinputSchema is an object with type: "object"
required-undefinederrorEvery required entry is a string declared in properties
param-type-missingwarningEvery parameter declares a type, enum, const, $ref or combinator
param-description-missingwarningEvery parameter has a description
size-budgetwarningTool at most 800 tokens, whole list at most 8000

Token estimate: ceil(length of compact JSON / 4). It is an approximation, not a tokenizer count.

References

  • references/tool-names.md: name rules and how to rename.
  • references/input-schema.md: input schema structure and required.
  • references/description-quality.md: writing descriptions that agents can act on.
  • references/token-budget.md: the estimate, the budgets and how to cut size.
  • references/rules.md: every rule, configuration keys and input limits.

Limits

  • $ref targets are not resolved and no full JSON Schema validation is done.
  • Input is limited to 5 MiB, 1000 tools and 64 levels of nesting; findings are capped at 10000.
  • Findings are advice on definition quality. A clean report does not prove the server behaves correctly.
  • Use it on definitions you are allowed to review; it only reads and reports.

The full TypeScript library and tests live at https://github.com/Trysac/u023-mcp-schema-lint.

SKILL.md

tile.json