Skip to main content
Glama

compile_context_pack

Ranks files, logs, JSON, and docs against a task query, then compiles a token-budgeted XML context pack with verbatim top files, dependency skeletons, clustered logs, and a dropped-file list.

Instructions

BM25-ranked, token-budgeted multi-artifact context compiler. Ranks source files, logs, JSON dumps, and docs against a taskQuery, keeping top files verbatim, skeletonizing supporting dependencies, clustering logs, and outputting a strict XML context pack + dropped-file manifest.

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": {
      "taskQuery": "<taskQuery>",
      "files": "<files>"
    },
    "name": "compile_context_pack"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYes
fullTopKNoHow many top-ranked code files to preserve verbatim when budget permits (default: 2).
taskQueryYesNatural-language task, bug report, or target symbols to rank relevance against.
tokenBudgetNoStrict max token budget for the compiled bundle (default: 8000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the ranking method, strict budget enforcement, per-file treatment (verbatim vs skeletonized), and the two outputs. It does not state the return channel (XML returned inline vs written to disk), what happens when the budget cannot fit even skeletonized content, or whether output is deterministic.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences, front-loaded with the identity of the tool, then the pipeline in execution order. Every clause carries information; there is no filler or repetition.

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

Completeness3/5

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

For a 4-parameter orchestration tool with no output schema, the description should say how the pack and manifest are delivered and how failure cases surface. It names the output artifacts but not their form or location, leaving a real gap for a tool whose whole value is the produced bundle.

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

Parameters4/5

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

Schema coverage is 75% and the description adds genuine meaning beyond it: it establishes that taskQuery drives BM25 ranking, and that fullTopK and tokenBudget interact ('keeping top files verbatim when budget permits'), clarifying a constraint the schema alone leaves implicit.

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?

States a specific verb+resource with unusual precision: a BM25-ranked, token-budgeted multi-artifact context compiler, and enumerates the transformations (verbatim top files, skeletonized deps, clustered logs). However, it never distinguishes itself from the near-twin sibling 'compile_repo_context' or explains how it relates to the narrower 'skeletonize_code' and 'compress_logs_and_traces' it appears to subsume.

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?

No explicit when-to-use, when-not, or alternative-selection guidance. The multi-artifact framing (files, logs, JSON, docs) weakly implies a heterogeneous-input scenario, but nothing tells an agent whether to call this versus compile_repo_context or to chain the narrower tools.

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