Skip to main content
Glama

Audit a repo for LLM token waste

audit_repo_token_waste

No API key needed. Static-analyze a public GitHub repo (e.g. {"repo": "owner/name"}) or a set of source files for LLM token waste: uncached static prompts, frontier models on extraction tasks, hot loops, non-deterministic repeat calls, and prompt-caching mis-integration (caching gated on model names, volatile values in the system prompt, random ids in history, wrong-provider cache markers, misplaced breakpoints, cost math that ignores cached tokens). Returns findings with fixes and an estimated recoverable percentage.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "audit_repo_token_waste"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNoGitHub owner/name (public)
filesNoAlternative to repo: files to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

'Static-analyze' discloses that code is inspected rather than executed, and 'No API key needed' removes an auth question the annotations never address (openWorldHint=true still implies remote fetch of the repo). It also describes the return shape ('findings with fixes and an estimated recoverable percentage'), adding value beyond the readOnlyHint=false/destructiveHint=false pair.

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?

Front-loaded with the no-key prerequisite and the two input modes before the long parenthetical checklist. The defect enumeration is dense but each item is specific; it could be trimmed, but nothing is filler.

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

Completeness5/5

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

Two optional, mutually exclusive inputs, no output schema, and the description covers the return content, the auth prerequisite, and the analysis mode. Nothing an agent needs before calling is missing.

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 coverage is 100%, so both parameters are already documented and 'files' is already labeled as an alternative to 'repo'. The description adds only the concrete example {"repo": "owner/name"} and reinforces the either/or relationship; that is marginal over baseline.

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

Purpose5/5

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

States a specific verb ('Static-analyze') plus both accepted resources (a public GitHub repo or a set of source files) and enumerates the exact defect classes it looks for. An agent can distinguish this from calculate_model_arbitrage or optimize_prompt_payload without opening sibling schemas.

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

Usage Guidelines3/5

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

'No API key needed' and the repo-or-files phrasing give real invocation context, and the tool's audit framing implies when it is applicable. However, there is no explicit when-not guidance and no routing versus siblings such as optimize_prompt_payload, which sounds adjacent and could be confused with it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.