Skip to main content
Glama

extract_relevant_context

Identifies and packages only code files relevant to a given coding task, omitting unrelated files to reduce token usage.

Instructions

Extracts and packages only the code files most relevant to a specific user coding task, pruning irrelevant files to save tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesTask description or coding prompt (e.g., "Fix JWT authentication token expiration error")
rootDirNoPath to repository root directory
maxTokensNoToken budget ceiling (default: 40000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral transparency burden. It does disclose the key behavior of pruning irrelevant files and packaging only relevant code, which is useful. However, it does not clarify whether the operation is read-only, whether files are modified or written anywhere, or what the packaged result looks like.

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 a single clear sentence with no filler and it front-loads the core action and resource. The slight redundancy between 'only...most relevant' and 'pruning irrelevant files' keeps it from being a perfect 5.

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?

The description is enough to understand the tool's main job, but with no output schema and no annotations, it leaves ambiguity about the returned package format, side effects, and behavior when maxTokens or rootDir are provided. Given the moderate complexity and complete parameter schema, this is adequate but not fully complete.

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 the schema already documents all three parameters. The tool description adds no parameter-specific meaning beyond the schema, such as how maxTokens influences pruning or how rootDir is resolved, so the baseline 3 is appropriate.

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 states a specific verb ('Extracts and packages'), a clear resource ('code files'), and a clear selection criterion ('most relevant to a specific user coding task'). It also signals what makes it distinct from generic mapping or outlining tools: pruning irrelevant files to save tokens.

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 implies the tool should be used when a user has a concrete coding task and wants only relevant source files, but it does not explicitly mention sibling alternatives or state when not to use it. The usage context is present but largely inferred rather than stated.

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