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 (10 sats); HTTP 400 if invalid.

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": {
      "content": "<content>"
    },
    "name": "prune_context_skeleton"
  }
}

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

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds real operational context beyond that: 32 KB payload ceiling, 60 RPM rate limit, L402 payment (10 sats) or ?demo=true access, and HTTP 400 on invalid input. However, it omits what the response looks like or how it behaves when the target_ratio is unreachable, so it does not go beyond a solid 3 given the annotations already carry the read-only contract.

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-loads the value proposition and compression ratio before usage and operational constraints. It is dense but every clause carries information; the third sentence is slightly crammed with limits, payment, and error code, but nothing is padding.

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-coverage schema, and an output schema, the description covers what an agent needs to invoke it correctly: retention semantics, size/rate limits, and payment path. The small gap is that the advertised 50–80% compression is not reconciled with the target_ratio range (0.15–0.85, default 0.45), which could confuse an agent setting that value.

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 including the pruning_mode enum and target_ratio bounds are already documented in the schema. The description's only added nuance is the phrase 'with enum defaults' and its restatement that query-matched lines get priority, which largely duplicates the schema text. Baseline 3 applies.

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 (large source files, logs, transcripts) with quantified effect (50–80%) and explicit retention guarantees (signatures, imports, error frames, query-matched lines). This is clearly distinguishable from siblings like summarize_technical_document or plan_context_token_budget.

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?

Provides an explicit 'Use when shrinking oversized source files or logs before feeding them into an LLM prompt' trigger, and names the alternative (plan_context_token_budget) with the exact condition that selects it (token counting / cost math 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