Skip to main content
Glama

AST-Aware Context Window & Source Code Skeleton Pruner

prune_context_skeleton
Read-onlyIdempotent

Compress oversized source files, logs, or transcripts by 50–80% to fit LLM context budgets while preserving all signatures, imports, error frames, and query-matched lines.

Instructions

Compresses large source files, logs, or transcripts by 50\u201380% to fit an LLM context budget while preserving 100% of function/class/type signatures, imports, error frames, and query-matched lines. Use when shrinking oversized source files or logs before feeding them into an LLM prompt; for counting BPE tokens across prompt segments and calculating multi-model inference costs without altering text, use plan_context_token_budget instead. Read-only edge call (32 KB, 60 RPM): accepts 'content' (with enum defaults), uses '?demo=true' or L402 (10 sats); HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
contentYesRaw source code, document, or multi-turn transcript to compress.
focus_queryNoOptional symbol or keyword query whose matching lines receive maximum retention priority.
pruning_modeNoSalience weighting preset; defaults to 'ast_signatures_first' when omitted.
target_ratioNoTarget token retention ratio between 0.15 and 0.85; defaults to 0.45 when omitted.

Output Schema

NameRequiredDescriptionDefault
tokens_savedYesNet BPE tokens eliminated.
preserved_symbolsYesFunction, class, interface, and struct identifiers retained.
compressed_contentYesPruned text with elision markers where low-salience lines were removed.
original_tokens_estYesEstimated BPE token count of the unpruned input.
compressed_tokens_estYesEstimated BPE token count after structural pruning.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.3

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing the operational envelope: 32 KB payload cap, 60 RPM throttle, demo=true or L402 auth at 10 sats, and HTTP 400 on invalid input. Those are exactly the constraints an agent must know before calling a remote edge endpoint.

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 value proposition and the preservation guarantee, then routing, then transport limits – good ordering with no filler. The final telegraphic clause ("accepts 'content' (with enum defaults)") is compressed to the point of ambiguity and slightly undercuts an otherwise tight description.

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?

With annotations, a full input schema, and an output schema, the description covers the remaining gaps: reduction range, what is preserved, alternative tool, rate/payload limits, and error behavior. Only the garbled parameter clause leaves a small hole, and the output schema removes any need to explain return values.

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% and every parameter including the enum and the 0.15–0.85 ratio range is already documented there, so the baseline is 3. The only added param note ("accepts 'content' (with enum defaults)") is vague and actually conflates the string `content` param with the `pruning_mode` enum, adding no usable meaning.

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 (compresses) plus the exact resources (source files, logs, transcripts) and the concrete outcome (50–80% reduction while preserving signatures, imports, error frames, and query-matched lines). It also names the sibling it is not (plan_context_token_budget), so an agent can distinguish the two without opening a schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ("shrinking oversized source files or logs before feeding them into an LLM prompt") and explicit when-not-to-use with the named alternative ("for counting BPE tokens... use plan_context_token_budget instead"). Nothing is left to inference.

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

Deploy Server

Other Tools