Skip to main content
Glama

compile_repo_context

Compiles a token-budgeted context pack from a local repository by ranking files with BM25 against a task query and mixing verbatim target code with line-indexed skeletons.

Instructions

Walk a local repository on disk (skipping node_modules, .git, lockfiles, binaries, and .env secrets), rank files against taskQuery via BM25, and compile a strict token-budgeted context pack mixing verbatim target code and line-indexed skeletons.

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": {
      "rootPath": "<rootPath>",
      "taskQuery": "<taskQuery>"
    },
    "name": "compile_repo_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullTopKNoTop code files to keep verbatim (default: 2).
maxFilesNoMax source files to scan (default: 200).
rootPathYesAbsolute or relative directory path of the repository to pack.
taskQueryYesBug description, feature goal, or symbol names.
tokenBudgetNoStrict max token budget (default: 8000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the whole burden and does well: it discloses exclusion rules (node_modules, .git, lockfiles, binaries, .env secrets), the BM25 ranking approach, and that the token budget is strict. What it omits is whether it only reads files or writes artifacts, and how it behaves on oversized repos.

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?

It is a single dense sentence with zero filler and the primary action front-loaded. The many parenthetical clauses make it harder to scan than a short multi-sentence structure would be, but nothing is wasted.

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?

For a five-parameter tool with no output schema and no annotations, the description covers the important behavior: what is scanned, what is skipped, how ranking works, and what the pack contains. Only the output delivery format and any side effects remain unstated.

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 already 100%, but the description adds real meaning: taskQuery is what files are BM25-ranked against, tokenBudget is enforced strictly, and fullTopK controls which files stay verbatim. That goes beyond the schema's terse field notes.

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 concrete verbs and a resource: walk a local repository, rank files via BM25, and compile a token-budgeted context pack. The mechanism (verbatim code plus line-indexed skeletons) is specific enough to picture the output. It does not explicitly differentiate itself from the sibling compile_context_pack, which keeps it below a 5.

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

Usage Guidelines3/5

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

Usage is only implied: the required rootPath and taskQuery make clear this is for local-repo, task-driven packing. There is no explicit statement of when to prefer this over compile_context_pack or skeletonize_code, and no prerequisites or exclusions are given.

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