Skip to main content
Glama

edit_preview

Check where an anchor text matches in a file to confirm uniqueness before editing. Returns match count, line numbers, and snippets without modifying the file.

Instructions

Preview where old_string matches in a file without modifying it.

Returns match count, 1-based line numbers, and small snippets so the caller can confirm an anchor is unique before committing to edit. Read-only and intentionally cheap — under ~200 tokens — so it can be called freely as a probe.

Args: path: File path to search. old_string: Anchor text. Must match exactly (whitespace, indentation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
old_stringYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNo
pathNo
foundNo
match_countNo
line_numbersNo
contextNo
Behavior5/5

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

No annotations provided, but the description fully discloses read-only behavior, returns match count/line numbers/snippets, exact matching requirement, and cheap token cost. This fully covers behavioral traits.

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?

Description is concise, front-loaded with the core purpose, then details on return values and usage guidelines. Every sentence adds value with no 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?

Given the tool has an output schema and is simple search, the description covers behavior, parameters, limitations, and usage context completely. No gaps.

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?

Schema has 0% description coverage, but the 'Args' section in the description adds detailed semantics: path as file path, old_string as anchor text with exact match rules (whitespace, indentation). Description compensates fully.

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 previews matches of old_string in a file without modifying it, distinguishing it from edit (modification) and grep (general search). The verb+resource structure is specific and unambiguous.

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?

Explicit guidance on when to use: to confirm an anchor is unique before committing to edit. Also notes it is intentionally cheap (~200 tokens) so it can be called freely as a probe, providing clear context for usage.

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/CoderDayton/semantic-cache-mcp'

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