Skip to main content
Glama

audit_mcp_schema_tokens

Read-onlyIdempotent

Breaks down MCP tools[] or .mcp.json JSON Schema token weight per server and tool, computes multi-turn prefix cost, and flags open schemas, verbose descriptions, and wildcard mounts.

Instructions

Break down MCP tools[] or .mcp.json configuration JSON Schema token weight per server and per tool, compute multi-turn cumulative prefix cost, and flag additionalProperties: true schemas, verbose tool descriptions, and wildcard eager mounts.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mcpJson": "<mcpJson>"
    },
    "name": "audit_mcp_schema_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
turnsNoSession turn count used to compute cumulative prefix token spend (default: 30).
mcpJsonYesJSON string containing an MCP tools[] array, { tools: [...] } payload, or .mcp.json / claude_desktop_config.json { mcpServers: { ... } } configuration.
modelIdNoReference LLM pricing tier ID used to calculate uncached, 5m TTL miss, and warm-cache USD cost.claude_sonnet_4_5
verboseDescriptionCharsNoCharacter length threshold above which a tool description is flagged as VERBOSE_TOOL_DESCRIPTION.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so safety is covered. The description adds useful behavioral context about what is computed (per-server/per-tool weight, cumulative multi-turn prefix cost, three cost tiers) and the three flag categories, but says nothing about output shape or how flags are surfaced. With annotations doing the safety work, this is adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence that front-loads the primary action (token weight breakdown) before the secondary computations and flags. Every clause carries content, though the three-part construction is slightly hard to parse on first read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only analysis tool with no output schema, full parameter coverage, and rich annotations, the description covers inputs, computations, and the flag taxonomy sufficiently to call it correctly. The main residual gap is that the returned structure and the exact flag names/semantics are not described.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters (turns, mcpJson, modelId, verboseDescriptionChars) are already documented in the schema. The description reinforces the purpose of the turn count and the verbose flag threshold but adds no syntax, format, or edge-case meaning beyond what the schema states; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource: it tokenizes JSON Schema weight for MCP tools[]/.mcp.json payloads, per server and per tool, then flags specific anti-patterns. That is far more concrete than the sibling names alone would imply, though it never names a sibling to distinguish itself from audit_instruction_bloat or simulate_agent_session_cost.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Applicability is only implied by the accepted input formats ('MCP tools[] or .mcp.json configuration'), with no explicit when-to-use, when-not-to-use, or pointer to the sibling tools that also deal with cost. An agent must infer routing from the scope sentence alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.