Skip to main content
Glama

compile_context

Pass changed symbol IDs or a git ref to compile a token-bounded view of callers, callees, and related functions. Include a bug report or issue text to focus on symbols relevant to the problem.

Instructions

Compile LLM-ready context for a change.

Give it changed symbol IDs (e.g. ./src/auth.py:validate_jwt) or a git ref (e.g. HEAD~1), and it returns the callers, callees, and related functions the model needs to make the change safely — packed into max_tokens with a disclosure header showing what was dropped.

Optionally pass task_description (the bug report or issue text) to bias retrieval toward symbols relevant to the described problem — the one signal the graph alone can't provide.

Args: repo_path: Absolute path to the repository. If omitted, uses the --repo from server startup. changed_symbols: List of changed symbol IDs (e.g. ["./src/auth.py:validate_jwt"]). Mutually exclusive with git_ref. git_ref: Git ref to detect changes from (e.g. "HEAD~1"). Mutually exclusive with changed_symbols. When only task_description is given (no changed_symbols or git_ref), defaults to "HEAD". task_description: The bug report or issue text. Biases retrieval toward symbols semantically related to the described problem, not just structurally near the changed symbols. max_tokens: Token budget for the context (default 8000). meta: Disclosure header level: "full" (default), "compact", or "off". The pass@1 effect of meta level is UNMEASURED.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
metaNofull
git_refNo
repo_pathNo
max_tokensNo
changed_symbolsNo
task_descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It exposes useful behavioral details: output is 'packed into max_tokens', a disclosure headers shows what was dropped, retrieval can be biased by task_description, and the pass@1 effect of the meta level is explicitly marked 'UNMEASURED'. These are substantive disclosures, not merely rephrased schema information.

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?

The description is front-loaded with the core action and then expands into concrete input formats, defaults, and caveats. It contains no filler, yet it is rather long due to the detailed Args block. Every sentence earns its place, and the most critical behavioral caveat ('UNMEASURED') is included without unnecessary qualification.

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 6-parameter tool with no annotations and no input-schema descriptions, the description covers all required behavior: input formats, defaults, output composition, token budget, disclosure header, and task bias. The one gap is explicit behavior when all inputs are omitted: it only explains defaulting to HEAD when 'task_description' is given, not what happens when no parameters at all are passed. This is a small but real completeness gap.

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

Parameters5/5

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

Although input-schema content coverage is 0%, the description's Args block thoroughly documents all six parameters with examples, defaults, mutual exclusivity, and behavioral caveats. It explains the exact meaning of changed_symbols and git_ref, the default git_ref when only task_description is passed, and the enum-like behavior of meta. This fully compensates for the sparse schema.

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 opening sentence states a specific verb and resource: 'Compile LLM-ready context for a change.' It further clarifies the resource by naming the accepted inputs (changed symbol IDs or git ref) and the returned content (callers, callees, related functions). It does not explicitly differentiate from the sibling tools, but the purpose is clear enough to be usable in isolation.

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?

The description gives strong input-selection guidance: changed_symbols vs git_ref are mutually exclusive, and task_description alone implies HEAD. However, it says nothing about when to use compile_context over its siblings (find_impact, explain_selection, verify_retrieval), so the when-to-use guidance is limited to parameter choices rather than tool-disambiguation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/trakshan-mishra/Diffcontext'

If you have feedback or need assistance with the MCP directory API, please join our Discord server