Skip to main content
Glama

llm_edit

Route code-edit reasoning to a cost-effective model and receive JSON instructions with file, old_string, and new_string pairs to apply edits mechanically.

Instructions

Route code-edit reasoning to a cheap model and return exact edit instructions.

Instead of Opus reasoning about what to change (expensive), a cheap model reads the files, figures out the edits, and returns JSON {file, old_string, new_string} pairs that Claude can apply mechanically via the Edit tool.

How to use the result: After calling this tool, apply each edit instruction using the Edit tool with the exact old_string → new_string pairs provided.

Best for: refactoring, bug fixes, adding small features to existing files.

Args: task: Natural-language description of what to change (e.g. "Add type hints to all public functions in router.py"). files: List of file paths to read and include in the prompt. Relative paths are resolved from the current working directory. Files larger than 32 KB are truncated with a note. context: Optional conversation context to help the model understand the task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYes
filesYes
contextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description must fully inform about behavior. It explains the tool routes to a cheap model, returns JSON pairs, and truncates large files. However, it does not explicitly state that the tool does not modify files (only returns instructions), nor does it mention any side effects, permissions, or limits. This is a minor gap.

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 fairly long but well-structured with sections and bullet points. It front-loads the key purpose. Some text (e.g., 'Instead of Opus reasoning...') adds context but could be trimmed. Overall, it earns its length.

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?

Given the tool's complexity (3 params, code editing), the description covers input, output format, usage, and best-fit scenarios. It mentions file size limits but lacks error handling or rate limits. The presence of an output schema (not shown) may further detail returns, but the description suffices.

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?

The input schema has 0% description coverage (only title fields), but the description adds substantial meaning: 'task' is a natural-language description, 'files' are paths with truncation note, and 'context' is optional conversation context. This compensates fully for the lack of schema descriptions.

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 the tool's purpose: 'Route code-edit reasoning to a cheap model and return exact edit instructions.' It identifies the verb (route/return) and resource (code-edit reasoning). However, it does not explicitly distinguish from sibling tools like llm_code or llm_fs_edit_many, though the mention of 'cheap model' and JSON output hints at differences.

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

Usage Guidelines4/5

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

The description provides explicit use cases: 'Best for: refactoring, bug fixes, adding small features to existing files.' It also explains how to use the result: 'apply each edit instruction using the Edit tool.' No explicit when-not-to-use or alternatives, but the guidance is clear and actionable.

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/ypollak2/llm-router'

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