Skip to main content
Glama

get_feature_context

Read-onlyIdempotent

Retrieve ranked source code snippets matching a feature description, controlled by a token budget.

Instructions

Search code by keyword/topic → returns ranked source code snippets within a token budget. Use when you need to READ actual code for a concept or feature. For structured task context with tests and entry points, use get_task_context instead. For symbol metadata without source, use search. Read-only. Returns JSON (default) or Markdown: { items: [{ symbol_id, name, file, source, score }], token_usage } | { content: "...markdown..." }. Set output_format: "toon" for lossless TOON encoding — cheaper LLM tokens on tabular payloads. Hard-capped by memory.recall.timeoutMs (default 5000 ms); on timeout returns { items: [], token_usage, degraded: true } so the agent turn never blocks on slow IO.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesNatural language description of the feature to find context for
token_budgetNoMax tokens for assembled context (default 4000)
output_formatNoOutput format. "json" (default) returns structured items; "markdown" returns LLM-friendly fenced code blocks (~15-20% token savings, easier for the model to read); "toon" returns Token-Oriented Object Notation — 30-60% fewer tokens, lossless.
Behavior5/5

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

Beyond annotations (readOnlyHint, etc.), description adds critical behavioral details: read-only nature, timeout behavior with hard cap and degraded response, output format options including TOON encoding benefits, and token budget limits. This fully informs agent 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?

Description is front-loaded with core purpose and usage guidelines, then covers details. While moderately long, every sentence adds value (timeout, formats, token economy). Minor redundancy ('Read-only' already implied by annotations) but overall efficient.

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?

Given the tool's complexity (search with token budget, multiple output formats, timeout behavior), the description is remarkably complete. It explains return structure, failure mode, and format trade-offs. No output schema needed because description covers it.

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 100%, setting baseline at 3. Description adds significant meaning: explains `description` as natural language query, `token_budget` as max tokens, and `output_format` with format-specific benefits (e.g., TOON saves 30-60% tokens). This exceeds baseline.

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?

Description clearly states the tool searches code by keyword/topic and returns ranked snippets within a token budget. It uses a specific verb ('Search') and identifies the resource ('code by keyword/topic'), distinguishing it from siblings like get_task_context and search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('when you need to READ actual code for a concept or feature') and provides specific alternatives: 'For structured task context with tests and entry points, use get_task_context instead. For symbol metadata without source, use search.'

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/nikolai-vysotskyi/trace-mcp'

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