Skip to main content
Glama

get_feature_context

Read-onlyIdempotent

Describe a feature in natural language and get ranked source snippets within a token budget, enabling quick code reading without exceeding context limits.

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" saves ~40-60% tokens (drops scores, fqn, signatures, summaries). Use to pick a candidate before 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.

  1. Changed1 schema field changedv3.31.0
    • changedInput schema / properties / detail_level / description
      Previous value: -"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\"."New value: +"Output verbosity. \"minimal\" saves ~40-60% tokens (drops scores, fqn, signatures, summaries). Use to pick a candidate before get_symbol. Default: \"default\"."
  2. 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)."
  3. Added
  4. Removedv1.38.0
  5. 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"
      +}
  6. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so that baseline is covered. The description adds valuable non-obvious behavior: timeout behavior ('Capped by memory.recall.timeoutMs (default 5000ms); on timeout returns { items: [], token_usage, degraded: true }'), which is not present in annotations or schema. It also states read-only and return format, adding context beyond structured fields.

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 efficient: first sentence states purpose, second gives usage and alternatives, third states read-only and return format, fourth adds output_format nuance, fifth covers timeout behavior. Each sentence earns its place, though the timeout detail adds length. It is appropriately sized for the tool's complexity and well front-loaded.

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?

With no output schema, the description must explain return values, and it does: 'Returns JSON (default) or Markdown: { items: [{ symbol_id, name, file, source, score }], token_usage } | { content: "...markdown..." }.' It also covers the timeout degraded response. It doesn't mention rate limits or permissions, but those are not critical given read-only annotations. The description is complete enough for correct invocation.

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% (all 4 parameters have descriptions), so the baseline is 3. The description does mention token_budget ('token budget') and output_format ('toon'), but these are already fully documented in the schema with comparable detail. It adds no new semantic meaning for parameters beyond what the schema provides.

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 opens with a specific verb and resource ('Search code by keyword/topic → returns ranked source snippets within a token budget'), making the core function immediately clear. It also differentiates from siblings by naming get_task_context and search with their distinct use cases, so an agent can tell them apart without opening schemas.

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?

The description explicitly states when to use this tool ('when you need to READ actual code for a concept or feature') and gives alternatives with guidance: 'For structured task context with tests and entry points use get_task_context instead; for symbol metadata without source use search.' This satisfies the explicit when/when-not/alternative criterion.

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