Skip to main content
Glama

Diogenes Context Compression, Code Patching & Deterministic Solver MCP

AST-Aware Context Window & Source Code Skeleton Pruner

prune_context_skeleton
Read-onlyIdempotent

Compresses large source files, logs, or transcripts by 50–80% 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 (50 sats); HTTP 400 if invalid.

Input Schema

TableJSON 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

TableJSON 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. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses the compression magnitude, the 100% preservation guarantee, a 32 KB call size and 60 RPM rate limit, payment options (?demo=true or L402 at 50 sats), and the HTTP 400 failure mode. This is substantial behavioral context the annotations do not carry.

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 purpose, then usage and alternatives, then operational constraints. Every clause carries information, though the final sentence is densely packed with limits and auth details. Efficient and well-ordered overall.

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?

An output schema exists, so return values need not be described. The description covers purpose, sibling routing, resource limits, authentication, and error behavior, leaving no material gap for correct invocation.

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 the parameters are fully documented in structured data and the baseline is 3. The description only restates 'content' and alludes to enum defaults without adding semantics the schema lacks. No compensation is required, but no value is added either.

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) and resource (source files, logs, transcripts) with a concrete outcome (50–80% reduction while preserving signatures, imports, error frames). It explicitly distinguishes itself from the sibling plan_context_token_budget, which does token counting without altering text. An agent can identify the tool's function without opening the 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?

Gives an explicit when-to-use condition ('shrinking oversized source files or logs before feeding them into an LLM prompt') and names the alternative with the contrasting condition (counting BPE tokens/costs without altering text). 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources