Skip to main content
Glama
fast-indexer-mcp
by Akramx15

ast_context_search

Extract the enclosing function, method, or class scope around a symbol in a source file, with optional full-body output up to 120 lines for precise code context.

Instructions

Extract enclosing function/method/class scope around a symbol inside one file (supports full_scope).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>",
      "pattern": "<pattern>"
    },
    "name": "ast_context_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
patternYesSymbol or keyword to locate
file_pathYesAbsolute path to source file
full_scopeNoReturn full enclosing function/method/class body up to 120 lines (default: false)
context_radiusNoLines before/after match when full_scope=false (default: 4)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.1

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does reveal the read-and-extract nature, the single-file constraint, and the 120-line ceiling on full_scope, but it says nothing about what happens when the pattern matches zero or multiple times, nor about the shape of the returned excerpt.

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?

A single front-loaded sentence with no filler, and the distinguishing constraint ("inside one file") arrives before the parenthetical. It is efficient, though bordering on terse for a tool with four parameters and no annotations.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description must cover behavior on its own, and it leaves the return value, no-match handling, and multi-match behavior unspecified. The parameter surface is fully documented by the schema, but the result-side behavior is a real gap for an extraction tool.

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%, so all four parameters are already documented, including defaults and the 120-line cap for full_scope. The description only echoes the existence of full_scope and adds no format, syntax, or interaction detail beyond the schema.

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?

The description pairs a specific verb ("Extract") with a concrete resource ("enclosing function/method/class scope around a symbol") and scopes it to "inside one file". That single-file scoping implicitly separates it from project-wide siblings like project_symbol_outline, though no sibling is named explicitly.

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?

Usage is only implied: the phrase "inside one file" tells an agent this is the right tool when the file is already known, and the full_scope note hints at a read-more mode. There is no explicit when-to-use, when-not-to-use, or named alternative, so the agent must infer routing from the sibling names.

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