Skip to main content
Glama

get_context

Retrieves the most relevant code for a task within a hard token budget. Pass a bug report, feature request, or stack trace to get ranked files and fitted function bodies.

Instructions

The most relevant code for a task, packed into at most budget_tokens tokens.

Pass the task in plain words (a bug report, a feature request, a stack trace). Files are
ranked by full-text match, meaning (local embeddings), names and paths the task mentions
and git history; function bodies and outlines are then fitted into the budget.

Input Schema

NameRequiredDescriptionDefault
taskYes
budget_tokensNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses the ranking signals (full-text, local embeddings, mentioned names/paths, git history) and that function bodies and outlines are fitted into the budget. It omits cost/latency implications of embedding-based ranking and any failure behavior.

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 short paragraphs, the core promise front-loaded in the first line, then the input guidance and ranking mechanics. Every sentence carries information; nothing is redundant.

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?

An output schema exists so return shape needn't be explained, and the description covers the essential mechanics of ranking and budgeting. It is slightly incomplete on performance characteristics and budget edge cases, but nothing essential to correct invocation is missing.

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 0%, so the description must compensate, and it does for both parameters: `task` is explained with concrete examples and `budget_tokens` is given real meaning as the cap on packed tokens. It does not discuss the trade-off of a larger budget or what happens when the budget is very small.

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 ('packed into') and resource ('the most relevant code for a task'), and the token-budget scope makes it distinguishable from simple lookups. It does not explicitly contrast with sibling tools like search or find_symbol, so differentiation is implied rather than stated.

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 instruction to pass the task 'in plain words (a bug report, a feature request, a stack trace)' gives useful input guidance and implies when the tool fits. There is no explicit when-not or comparison to the sibling search/find_symbol tools, leaving alternative selection to inference.

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