Skip to main content
Glama
nagendra-kon

repodigest-mcp

by nagendra-kon

pack_task_context

Read-only

Pack the code most relevant to a task into a token-bounded XML snippet. Describe the task in natural language and receive ranked, budget-limited source context.

Instructions

Pack the code most relevant to a task into a token-bounded XML snippet.

Ranks every symbol against query (BM25), takes the best match as the root, then breadth-first expands through its callees and callers, skipping (never truncating) any symbol that no longer fits.

Args: query: Natural-language description of the task, e.g. "validate user login". budget: Max tokens (cl100k_base) of packed source. The XML markup around the source (file/symbol tags, usage summary) is not counted, so allow ~10% headroom. signatures_only: Pack everything except the root symbol as signature + docstring. path: Repository root to search (default: the server's working directory).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo.
queryYes
budgetNo
signatures_onlyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

The description goes well beyond the readOnlyHint annotation, disclosing the BM25 ranking, root selection, breadth-first expansion through callees and callers, and the skip-never-truncate behavior. It also explains the budget semantics, noting that XML markup is not counted and advising ~10% headroom, plus the signatures_only behavior. This is rich behavioral detail.

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?

The description is dense but well organized: a one-sentence purpose, a compact algorithm summary, and a clearly separated Args block. Every sentence contributes useful information, and the most important behavioral facts are front-loaded before parameter details.

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?

For a complex 4-parameter tool with no schema descriptions, the description covers purpose, algorithm, parameter semantics, edge-case behavior (skipping vs truncating), and budget headroom. The output schema exists, so return-value details don't need to be in the description; nothing critical is missing for correct invocation.

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?

Despite 0% schema description coverage, the description fully compensates by explaining every parameter: query with an example, budget with tokenization and markup caveats, signatures_only with its exact packing behavior, and path with its default and scope. This gives an agent all the semantic information needed to set parameters correctly.

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?

The description clearly states a specific verb and resource: 'pack the code most relevant to a task into a token-bounded XML snippet.' It also distinguishes the tool from sibling symbol-focused tools by describing a query-based ranking and breadth-first expansion over callees and callers, which is a different scope than simply fetching a signature or dependency list.

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 intended use is implied through the purpose and the `query` argument ('Natural-language description of the task'), but the description does not explicitly explain when to choose this tool over get_symbol_signature or get_symbol_dependencies, nor does it state when not to use it. There are no exclusions or alternative-routing hints.

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