Skip to main content
Glama
achatainga

mcp-code-context

by achatainga

read_file_surgical

Read a file or extract a specific symbol from code, using precise AST-based operations to reduce token usage.

Instructions

Read a file or extract a specific named symbol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to file
projectRootYesProject root (REQUIRED)
symbolNameNoSymbol name to extract (optional)
classNameNoClass name for scoping (optional)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states a high-level function without any details about side effects, read-only guarantees, error behavior, or performance implications. For a surgical tool that extracts symbols, more transparency about what happens if the symbol is missing or how scoping with className works is needed.

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 a single, front-loaded sentence that conveys the two primary use cases. It is appropriately concise without redundancy. However, a second sentence explaining when to use the optional parameters could improve structure without much bloat.

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

Completeness2/5

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

For a tool with 4 parameters, no output schema, and many siblings, the description is insufficient. It does not explain return format, error handling (e.g., file not found, symbol not found), or the interaction between parameters. The agent may not know how to properly invoke it for specific scenarios.

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?

All four parameters have schema descriptions (100% coverage), so baseline is 3. The description adds value by linking symbolName and className to 'extract a specific named symbol', providing context that the schema alone does not. However, it doesn't clarify the relationship between symbolName and className or whether extracting a symbol returns the entire symbol definition.

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 clearly states two distinct actions: reading a file and extracting a named symbol. This distinguishes it from siblings like read_file_lines (reads lines) and search_symbols (searches for symbols). However, it could be more explicit about the 'surgical' nature (e.g., extracting a symbol from a file) and how it differs from reading the whole file.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool vs. alternatives like read_file_lines, search_symbols, or parse_file. It doesn't explain when the optional symbolName parameter should be used instead of reading the whole file, or when className is needed. This leaves the agent unsure about selection.

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/achatainga/mcp-code-context'

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