Skip to main content
Glama

get_context_brief

Generates a ranked, token-budgeted Markdown context brief for a coding task using hybrid retrieval, import relations, file skeletons, and git recency to surface relevant project files.

Instructions

Deterministic CONTEXT BRIEF for a coding task — the scout pyramid, layer 0.
Combines hybrid retrieval (vector/BM25), one-hop import-graph expansion,
file skeletons from the manifest and git recency into a ranked, budget-
packed markdown brief. Zero LLM calls, typically <500ms.

Args:
    task: The coding task in natural language.
    budget_tokens: Approximate token budget for the brief (default 4000).
    hint_files: File paths explicitly mentioned in the task (client-extracted).
    hint_symbols: Identifiers/symbols mentioned in the task (client-extracted).

Returns:
    Markdown brief: ranked files with symbols, import relations and
    top excerpts. Empty string when nothing relevant is indexed yet.

Input Schema

NameRequiredDescriptionDefault
taskYes
hint_filesNo
hint_symbolsNo
budget_tokensNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.8/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it delivers real behavioral facts: no LLM calls, deterministic output, sub-500ms latency, budget packing, and an empty string when the index is cold. What remains undisclosed is the indexing prerequisite in operational terms (must index_codebase have run first?) and any error/permission behavior.

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?

Front-loaded with the core promise, then clean Args/Returns sections with no duplicated filler. The opening 'scout pyramid, layer 0' is internal jargon that costs a clause without informing the agent, a small deduction.

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 4-parameter retrieval tool this is nearly self-sufficient: it covers what goes in, what comes out, cost profile, and the empty-index edge case. The remaining gap is workflow context — how it relates to the many search_* and get_* siblings in a 60-tool server.

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: all four parameters get meaning, including the crucial note that hint_files/hint_symbols are 'client-extracted' from the task text, plus the 4000 default for budget_tokens. It could go further on acceptable hint formats or budget trade-offs, hence 4 rather than 5.

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+resource ('Context brief for a coding task') and details the composition of that brief: hybrid retrieval, one-hop import-graph expansion, file skeletons, git recency. An agent can tell it produces a packed markdown digest rather than raw search hits. It never names a sibling to contrast with, though, so it falls short of 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?

'the scout pyramid, layer 0' implies a first-step workflow position, and 'Zero LLM calls, typically <500ms' implies it is cheap enough to call eagerly. But there is no explicit when-to-use/when-not guidance and no reference to alternatives like search_codebase, search_codebase_advanced or get_project_overview, leaving the routing decision to inference.

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