Skip to main content
Glama

get_feature_context

Read-onlyIdempotent

Search code by natural language to locate and review ranked source snippets for any feature or concept, staying within a token budget.

Instructions

Search code by keyword/topic → returns ranked source 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..." }. Supports output_format: "toon". Capped by memory.recall.timeoutMs (default 5000ms); on timeout returns { items: [], token_usage, degraded: true }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesNatural language description of the feature to find context for
detail_levelNoOutput verbosity. "minimal" returns ~40-60% fewer tokens (drops scores, fqn, signatures, summaries — keeps name/file/line). Use when you only need to pick a candidate before drilling in with get_symbol. Default: "default".
token_budgetNoMax tokens for assembled context (default 4000)
output_formatNo"json" (default, structured items), "markdown" (fenced code blocks, ~15-20% cheaper), or "toon" (lossless, 30-60% fewer tokens).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed3 schema fields changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / detail_level
      Added value: +{
      +  "description": "Output verbosity. \"minimal\" returns ~40-60% fewer tokens (drops scores, fqn, signatures, summaries — keeps name/file/line). Use when you only need to pick a candidate before drilling in with get_symbol. Default: \"default\".",
      +  "enum": [
      +    "minimal",
      +    "default",
      +    "full"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / output_format / description
      Previous value: -"Output 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."New value: +"\"json\" (default, structured items), \"markdown\" (fenced code blocks, ~15-20% cheaper), or \"toon\" (lossless, 30-60% fewer tokens)."
  2. Added
  3. Removedv1.38.0
  4. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / output_format
      Added value: +{
      +  "description": "Output format. \"json\" (default) returns structured items; \"markdown\" returns LLM-friendly fenced code blocks (~15-20% token savings, easier for the model to read).",
      +  "enum": [
      +    "json",
      +    "markdown"
      +  ],
      +  "type": "string"
      +}
  5. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Despite strong annotations (readOnly, idempotent, non-destructive), the description adds meaningful behavioral detail: token budget behavior, output format variants, timeout cap with default value, and a degraded response shape on timeout. It also confirms the read-only nature, aligning with annotations. No contradiction.

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 dense and front-loaded, with the core purpose and usage guidance first. It packs output shapes, timeout behavior, and alternatives into a compact block. Minor redundancy exists ('Read-only' repeats the annotation) and the toon reference is slightly tacked on, but overall every sentence earns its place.

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?

With no output schema, the description properly explains return formats and the degraded timeout case. It covers tool selection, read-only semantics, token budget, and output options. Given the tool's moderate complexity and annotations already handling safety, nothing critical is missing for an agent to call it correctly.

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 coverage is 100% and the schema already documents all four parameters, including defaults, enums, and constraints. The description reinforces token budget and output format behavior but does not add substantive per-parameter meaning beyond the schema, 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 action ('Search code by keyword/topic'), a precise result ('ranked source snippets'), and an explicit constraint ('within a token budget'). It also distinguishes the tool from siblings by naming get_task_context and search as alternatives, so an agent can tell them apart immediately.

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?

It gives an explicit when-to-use condition ('when you need to READ actual code for a concept or feature') and clear routing instructions: use get_task_context for structured task context with tests and entry points, and search for symbol metadata without source. This is exactly the kind of differentiation agents need.

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

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