Skip to main content
Glama

token_squeezer

Compresses Python source files by 50-70% using AST analysis to extract structural interfaces and docstrings, cutting context size for LLM prompts while preserving key signatures.

Instructions

AST-based context compressor. Shrinks Python source files by 50-70% by extracting structural interfaces and docstrings.

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": {
      "file_path": "<file_path>"
    },
    "name": "token_squeezer"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNointerface
file_pathYesPath to Python file to compress

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It discloses that the operation is lossy (extracting interfaces and docstrings) and the typical compression ratio, which is useful. However, it never says whether the original file is overwritten or a new artifact is produced, whether the output is returned in the response or written to disk, or what permissions are required. Those gaps matter for a tool that transforms source code.

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?

Two tight sentences that front-load the mechanism and the outcome, with zero filler. The only improvement would be to add a clause on output or mode behavior instead of leaving the description so sparse.

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

Completeness2/5

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

For a file-transforming tool with no output schema and no annotations, the description omits critical operational detail: destination of the compressed output, whether the source is modified, and the meaning of the mode parameter. It covers the what but not the how it behaves when invoked.

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

Parameters2/5

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

Schema coverage is only 50%: file_path is documented in the schema, but the mode enum has no description in either place. The description says nothing about what 'interface' versus 'compact' mode does, so an agent must guess which mode to pick. This is a real semantic gap that the description should have filled.

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 and resource: it compresses Python source files using AST analysis, extracting structural interfaces and docstrings. The '50-70%' figure adds concrete scope. It does not distinguish itself from the unrelated sibling tools, but none of them appear to overlap, so the purpose is still identifiable.

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?

There is no guidance on when to use this tool, when not to, or when to prefer an alternative approach such as a diff or summary tool. It also gives no hint about which situations call for compression rather than reading the file directly.

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