Skip to main content
Glama

read_for_edit

Get exact raw code around a symbol or line to copy as old_string for the Edit tool. Supports batch retrieval of multiple symbols.

Instructions

Use INSTEAD OF Read when preparing an EDIT. Returns exact RAW code around a symbol or line — copy directly as old_string for Edit tool. Supports batch: pass "symbols" array to get multiple edit contexts in one call. Unlike read_symbols (for reading/understanding), this returns unformatted code optimized for copy-paste into Edit. Optional: include_callers, include_tests, include_changes for enriched context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
symbolNoSymbol name to edit (e.g. "UserService.updateUser")
symbolsNoArray of symbol names for batch edit context (max 10). Alternative to single "symbol" — returns all symbols in one call.
lineNoLine number to edit (alternative to symbol)
contextNoLines of context around target (default: 5)
include_callersNoShow top callers of this symbol (saves a separate find_usages call)
include_testsNoShow related test file and test names
include_changesNoShow recent git changes in the target region
sectionNoSection to edit: heading (Markdown), top-level key (YAML/JSON), or "rows:1-50" (CSV). Returns raw section content for Edit old_string.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the output is raw/unformatted code, supports batch, and includes optional enrichment flags. It does not mention error handling, rate limits, or idempotency, but for a read-focused tool the description is sufficiently transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph with a clear front-loaded purpose, followed by concise details on batch usage, comparison with siblings, and optional parameters. Every sentence adds essential information without redundancy.

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?

Despite lacking an output schema, the description explains the return format (raw code for copy-paste). With 9 parameters and 25 sibling tools, the description provides enough context to differentiate and use the tool correctly for its intended purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters have schema descriptions (100% coverage). The description adds significant value: explains that the output is meant to be used directly as old_string for the Edit tool, clarifies that 'symbols' enables batch mode (max 10), and distinguishes the purpose of include_callers, include_tests, include_changes as saving separate API calls.

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 clearly states the tool is for preparing edits, returning raw code for use as old_string in an Edit tool. It distinguishes itself from generic Read and read_symbols, which are for reading/understanding, providing a specific verb+resource+use case.

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 advises 'Use INSTEAD OF Read when preparing an EDIT.' Contrasts with read_symbols ('Unlike read_symbols (for reading/understanding), this returns unformatted code optimized for copy-paste into Edit'). Also describes batch usage and optional enriched context parameters.

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/Digital-Threads/token-pilot'

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