ast-editor
The ast-editor MCP server enables AI agents to surgically edit source code and configuration files via Abstract Syntax Trees (ASTs), providing precise, token-efficient modifications (10–200x fewer tokens than whole-file rewrites) without brittle search-and-replace or diffs.
Structural Code Editing
Replace entire function definitions, bodies only, or signatures only (preserving decorators)
Replace, insert, or delete specific snippets inside function bodies
Add top-level symbols (functions, classes, constants), methods, or fields to classes
Insert content as a sibling before/after a named symbol
Delete entire function/class definitions (optionally including leading comments)
Parameters & Signatures
Add or remove parameters by name from function signatures
Import Management
Add/remove import or
#includestatements (duplicate-safe)Add/remove individual names from multi-name imports (
from X import a, b/import { a, b } from "mod")
Comments & Docstrings
Add, replace, or remove leading comment blocks above symbols
Replace or insert Python function/class docstrings
Config & Data File Editing (JSON, YAML, TOML, Python module-level literals)
Replace, add, or delete key-value pairs
Append to or remove elements from arrays/lists
Navigation & Reading (read-only)
List all top-level symbols with line numbers
Read a single symbol's source (full, interface skeleton, or signature only)
Retrieve all imports in a file
Find all syntactic references to an identifier
Supported Languages: Python, JavaScript, TypeScript, C, C++, Ruby, Go, Java — plus JSON, YAML, and TOML for config editing.
AST Code Editor MCP Server
A robust, language-agnostic Model Context Protocol (MCP) server that provides AI coding agents with the ability to edit files surgically via Abstract Syntax Trees (AST) instead of relying on token-heavy, brittle search-and-replace or diff operations.
Why AST Edits?
Every non-AST edit format — search/replace, unified diff, whole-file rewrite — requires the model to copy text perfectly from a file it saw once. One whitespace mismatch on a 4,000-line file and the edit fails. AST edits sidestep the problem entirely: the model names the target (e.g., LRUCache.get) and provides the new code; the parser figures out where it lives.
Geometric AGI benchmarked every major format across 4 models and 29 edit tasks. AST edits were the only format to hit 100% correctness on 3 of 4 models, with 18x fewer output tokens than whole-file rewrite, and zero format failures. Full methodology and results: AST Edits: The Code Editing Format Nobody Uses.
Credits
This MCP server was inspired by research from Jack Foxabbott and the team at Geometric AGI. Their full findings, benchmark suite, and data are available here:
Jack Foxabbott's original post (LinkedIn)
GeometricAGI/blog (Benchmark code & data)
Related MCP server: CodeSeeker-MCP
Estimated Token Savings
Per-edit output token savings versus other common edit formats:
Edit size | File size | vs whole-file rewrite | vs unified diff | vs search/replace |
1-line tweak | 100 LoC | 3–5x | ~1.5x | ~1.5x |
Function body rewrite | 500 LoC | 8–12x | 2–3x | 2–3x |
Function body rewrite | 4,000 LoC | 15–20x | 3–5x | 3–5x |
Add 2 lines to a function | any size | ~20x (via | 5–10x | 3–5x |
Per-read input token savings versus reading the entire file:
Read task | File size | AST reader tool | vs full file read |
One function's source | 500 LoC |
| ~20x fewer tokens |
One function's source | 2,000 LoC |
| ~50-100x fewer tokens |
Class API (10 methods, no bodies) | 500 LoC |
| ~10x fewer tokens |
Import block only | any size |
| ~20-50x fewer tokens |
Structural overview (names + line numbers) | any size |
| ~15-30x fewer tokens |
One function's signature | any size |
| ~50-200x fewer tokens |
For daily agent users, a realistic 40-60% reduction in total tokens per session is achievable, on average (combining output savings from surgical edits with input savings from targeted reads).
The savings come from four compounding effects:
Output tokens: Using
prepend_to_body/append_to_bodyfor small additions instead of rewriting whole function bodiesInput tokens: Using
read_symbol/read_interface/read_importsto read only what's needed instead of entire files (~10-20x fewer input tokens per read)Discovery:
list_symbols/get_signatureinstead of reading whole filesZero format failures: AST edits never fail on whitespace drift, eliminating retry loops that plague other formats.
Supported Languages & Capabilities
Language | Extensions | Structural edits | Comments | Docstrings | Notes |
Python |
| ✅ | ✅ | ✅ function/class | Decorators preserved. Module-level |
JavaScript |
| ✅ | ✅ | — | |
TypeScript |
| ✅ | ✅ | — | Interfaces are treated as classes for |
C |
| ✅ | ✅ | — |
|
C++ |
| ✅ | ✅ | — | Supports |
Ruby |
| ✅ | ✅ | — | Classes, modules, instance methods, |
Go |
| ✅ | ✅ | — |
|
Java |
| ✅ | ✅ | — |
|
JSON |
| ✅ (keys, values, arrays) | — (no comment syntax) | — | |
YAML |
| ✅ (keys, values, sequences) | ✅ | — | Block and flow sequences supported. |
TOML |
| ✅ (keys, values, arrays, tables) | ✅ | — |
|
Cross-cutting features:
Decorated functions (Python
@decorator): decorators are preserved on body/signature edits and included on delete.Byte-correct slicing: multi-byte characters (emoji,
═,→) handled safely in source text.Idempotent imports:
add_importskips exact duplicates automatically. For Go specifically, when a parenthesizedimport ( ... )block already exists, new specs are inserted inside the block rather than as a bare top-level line (which would be a syntax error for spec-only input like"path/filepath").Doc-comment-aware deletion:
delete_symbolby default removes the contiguous leading comment block above the symbol (Godoc, Javadoc,#///comment runs) so docs don't become orphaned. Opt out withinclude_leading_comments=False.
Language-specific design decisions
A few tools have language-specific semantics where multiple reasonable interpretations exist. The chosen behavior is documented here for transparency:
add_field (Ruby and Go) — option (a): literal text passthrough
Ruby:
add_field("LRUCache", " attr_accessor :capacity")inserts the literal string at the top of the class body. The tool does not auto-wrap bare names inattr_accessor— you provide the exact text you want (whether that'sattr_accessor,attr_reader,@instance_var = nilininitialize, orCLASS_CONST = 42).Go:
add_field("Cache", "\tversion int")inserts the literal string inside thestruct { ... }body. The tool does not infer types from bare names — you provide the full Go field declaration.Rationale: consistent with how
add_fieldworks for other languages (Python, JS/TS, C++) where the caller provides the full source text. The alternative option (b) — auto-wrapping (e.g.attr_accessor :foofrom the namefoo) — would be more magical but harder to use for edge cases (typed fields, readonly fields, field with default value, etc.).
add_method (Go) — option (a): top-level sibling insertion
add_method("Cache", "func (c *Cache) Has(key string) bool { ... }")locates thetype Cache struct { ... }declaration and inserts the new method immediately after it, at the top level (not inside the struct's braces).Rationale: Go methods are lexically top-level, not nested inside their receiver type — this matches how Go code is actually written. The alternative option (b) — refusing because "Go methods aren't inside structs" — would be pedantically correct but force callers to use
insert_after("Cache", content)instead, which loses the semantic signal that this is a method addition.
Tools Exposed
All tools require file_path to be an absolute path to an existing file.
Code editing — structural (Python, JS, TS, C, C++, Ruby, Go, Java)
Tool | Parameters | Description |
|
| Replace a full function definition (signature + body + decorators). |
|
| Replace only the body of a function, preserving signature and decorators. |
|
| Replace only the signature, preserving body and decorators. |
|
| Replace a byte-identical snippet inside a function body. Scoped to target's body; raises on multiple matches. |
|
| Delete a byte-identical snippet inside a function body. Scoped to target's body; raises on multiple matches. |
|
| Insert a snippet inside a function body. Pass exactly ONE of: |
|
| Insert top-level content. |
|
| Add a method at the end of a class body. |
|
| Add a field/attribute/member at the top of a class body. |
|
| Insert content as a sibling of a named symbol. |
|
| Delete a function or class definition block (including decorators). By default also consumes the contiguous leading comment block above the symbol (Godoc, Javadoc |
Parameters & signatures
Tool | Parameters | Description |
|
| Add a parameter to a function signature ( |
|
| Remove a parameter by name. |
Imports & includes
Tool | Parameters | Description |
|
| Add an |
|
| Remove a matching import line. |
|
| Add one name to an existing named-import statement: |
|
| Remove one name from a multi-name named-import statement (Python and JS/TS). If the last named import is removed and no default/namespace binding remains, the whole line is removed. |
Comments & docstrings
Tool | Parameters | Description |
|
| Edit the contiguous leading-comment block above a named symbol. |
|
| Replace or insert a Python function/class docstring. Python-only. |
Dict/list editing (JSON, YAML, TOML, AND Python module-level dict/list literals)
Tool | Parameters | Description |
|
| Replace the value of an existing config key. |
|
| Add a key-value pair to a dict/object/mapping/table. For Python, |
|
| Delete a key-value pair. Targets: JSON/YAML/TOML dotted path; Python |
|
| Append a literal value to a list/array/sequence. For Python, |
|
| Remove the first matching element from a list/array/sequence. |
Navigation & reading (read-only)
Tool | Parameters | Description |
|
| Formatted outline of all top-level functions, classes, and methods with line numbers. |
|
| Syntactic search for all occurrences of an identifier (no scope awareness). |
|
| Return source text of a single named symbol. |
|
| Return all import/include statements in the file. |
Target format: Use the exact function name (e.g., get) or dotted Class.method path (e.g., LRUCache.get). Decorated Python functions are fully supported — decorators are preserved when replacing bodies or signatures, and included when deleting or replacing the full function.
Tip: Call list_symbols first to discover exact target names before editing. This avoids guessing and makes subsequent edits much more reliable.
Which tool should I use?
A decision guide grouped by intent. Start at the top and pick the narrowest match.
Discovering what's in a file (do this first)
Don't know what symbols exist? →
list_symbolsNeed one specific function's full source? →
read_symbol(depth="full", the default — 10-20x cheaper than reading the whole file)Need a class's public API (methods + fields, no bodies)? →
read_symbol(target, depth="interface")Need just a function's signature? →
read_symbol(target, depth="signature")Need to see a file's imports/dependencies? →
read_importsWhere is a symbol used? →
find_references
Dotted targets descend into closures: Go stdioCmd.RunE (func_literal in struct field), TS app.handler (arrow function in object literal).
Adding new content
Intent | Tool |
New top-level function, class, constant, or type alias |
|
New method in an existing class |
|
New field/attribute/member in a class |
|
New content before or after a top-level symbol |
|
New lines at the top of an existing function body |
|
New lines at the bottom of an existing function body |
|
New lines at a specific spot inside a function body (anchored to existing text) |
|
New parameter on an existing function |
|
New import or |
|
New name in an existing |
|
New comment above a symbol |
|
New Python docstring on a function/class |
|
New key in a dict/object/mapping/table (any lang) |
|
New item in a list/array/sequence (any lang) |
|
Modifying existing content
Intent | Tool |
Rewrite the full function (signature + body) |
|
Rewrite only the body, keep the signature |
|
Change one statement/block inside a large body |
|
Change only the signature, keep the body |
|
Change only the leading comment above a symbol |
|
Change only the Python docstring |
|
Change the value of an existing config key |
|
Removing content
Intent | Tool |
Remove a function, method, or class |
|
Remove one statement/line inside a function body |
|
Remove a parameter from a function |
|
Remove an import or |
|
Remove one name from a multi-name named-import (Python or JS/TS) |
|
Remove a leading comment above a symbol |
|
Remove a key from a dict / config / JS-TS object literal |
|
Remove an item from a list/array |
|
Anti-patterns to avoid
Don't use
replace_functionorreplace_function_bodyto change a few lines — usereplace_in_body(scoped snippet match) orinsert_in_body(at="top" \| "bottom")for appending/prepending. Rewriting the whole function is wasteful and error-prone.Don't use
replace_signatureto add or remove one parameter — useadd_parameter/remove_parameter.Don't use
replace_valueto add a new key — useadd_key.replace_valueonly updates existing keys.Don't use
add_importto add a name to an existingfrom X import …or named import — useadd_import_name.Don't guess at target names. Call
list_symbolsfirst. Names are case-sensitive and must match exactly.
Logging & Debugging
The server logs all tool invocations and errors to stderr (safe for stdio transport — does not interfere with JSON-RPC). Logs include timestamps and severity levels.
To inspect logs when running under Claude Desktop, check ~/Library/Logs/Claude/mcp*.log (macOS) or %APPDATA%\Claude\logs\mcp*.log (Windows).
For interactive testing, use the MCP Inspector.
Prerequisites
This MCP server uses uv to manage its Python environment and dependencies automatically. Install uv if you don't have it already:
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Homebrew (macOS):
brew install uvpip (any platform):
pip install uvVerify the installation:
uv --versionFor more options (Docker, Cargo, WinGet, etc.), see the official uv installation docs.
Installation
Note: Replace
/absolute/path/tobelow with the actual path to this repository on your machine.
Method 1: CLI Configuration (Claude Code, Codex, Gemini)
If your agent supports adding servers via CLI, run the following:
Claude Code / Codex CLI / Gemini CLI:
--scope user installs the server globally so it's available in every project on your machine. Drop it if you only want the server active in the current project.
# Claude Code / Codex
[claude|codex] mcp add ast-editor --scope user -- uv --directory /absolute/path/to/ast-editor run ast-editor-mcp
# Gemini CLI
gemini mcp add --transport stdio --scope user ast-editor -- uv --directory /absolute/path/to/ast-editor run ast-editor-mcpMethod 2: JSON Configuration
For tools that use a mcp_config.json or settings.json file, add the following block to the appropriate file path.
Important: Use the absolute path to
uvfor"command", not just"uv". GUI-based MCP clients (Claude Desktop, Cursor, Antigravity) don't always inherit your shellPATH, so a bare"uv"will fail with a "command not found" error. Get your absolute path with:which uv # e.g. /Users/you/.local/bin/uv or /opt/homebrew/bin/uv
{
"mcpServers": {
"ast-editor": {
"command": "/absolute/path/to/uv",
"args": [
"--directory",
"/absolute/path/to/ast-editor",
"run",
"ast-editor-mcp"
]
}
}
}Agent | Configuration File Path |
Claude Desktop |
|
Cursor |
|
Windsurf | Agent Panel → "..." → MCP Servers → View raw config |
Antigravity |
|
Gemini CLI |
|
Using Standard Python (Fallback)
If you prefer not to use uv, install manually and point to the .venv executable in ast-editor directory:
python3 -m venv .venv && source .venv/bin/activate && pip install .{
"mcpServers": {
"ast-editor": {
"command": "/absolute/path/to/ast-editor/.venv/bin/python",
"args": ["-m", "ast_editor.server"]
}
}
}Agent Configuration (Important)
Coding agents are heavily biased toward their default tools. You must explicitly instruct them to use AST tools. The agent prompt lives in AST-EDITOR.md — a standalone file you wire into your agent's system instructions.
Claude Code / Claude Desktop (via @-include)
Claude Code supports @filename includes in CLAUDE.md. Copy the prompt file into your global config directory and add one include line:
cp /absolute/path/to/ast-editor/AST-EDITOR.md ~/.claude/
echo '@AST-EDITOR.md' >> ~/.claude/CLAUDE.mdOr for a single project, place it next to the project's CLAUDE.md and add @AST-EDITOR.md there.
Other agents (Cursor, Codex CLI, Windsurf, Antigravity, Aider, Gemini CLI, etc.)
Copy the contents of AST-EDITOR.md into your agent's instruction file (AGENTS.md, .cursor/rules/*.mdc, .windsurfrules, .github/copilot-instructions.md, system prompt, etc.). Most non-Claude agents don't support @-include — paste the prompt body directly.
Agent | Instruction file |
Any agent that reads |
|
Cursor |
|
GitHub Copilot |
|
Windsurf |
|
Antigravity |
|
Aider / Gemini CLI / generic | Rules file or system prompt |
Migrating from v1.x / pre-AST-EDITOR.md instructions
If your CLAUDE.md (or other rules file) contains an inline quoted "When editing ... use ast-editor" block from an older README version, delete that block and replace it with the @AST-EDITOR.md include (or paste the current file's contents). The old block will reference tool names removed in v2.0.0 consolidation (prepend_to_body, append_to_body, insert_before, insert_after, add_comment_before, replace_leading_comment, remove_leading_comment, read_interface, get_signature) — keeping it will cause agents to call tools that no longer exist.
v2.0.0 consolidated 10 closely-related tools into 4 parametrized tools. Mapping:
v1.x tool | v2.0.0 equivalent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The old tools are hard-removed — calling them will fail with "unknown tool". Behavior is preserved 1:1 by the new calls.
Available Tools
28 toolsadd_fieldA
Add a field/attribute/member at the top of a class body (fields-before-methods convention).
Use this when: You're adding a class attribute (Python), class field (JS/TS),
or member variable (C++).
Don't use this when: You're adding a method -> use add_method.
Example: class_target="LRUCache" content=' version = "1.0"'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| class_target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description discloses insertion at top and implies formatting via example. Does not detail error handling or overwrite behavior, but is generally transparent for a field addition tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise, well-structured with bullet points and example. No redundant sentences; every line adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Low complexity tool with output schema present; description covers purpose, usage, and gives example. Lacks return value info but output schema likely covers it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage; description only partially compensates via example (shows class_target and content). file_path is not explicitly described, leaving slight ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool adds a field/attribute/member at the top of a class body, following fields-before-methods convention. It differentiates from sibling add_method by mentioning it's for methods, not fields.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit 'Use this when' and 'Don't use this when' with a specific alternative tool (add_method). Provides language-specific contexts (Python, JS/TS, C++), making it clear when to invoke.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_importA
Add an import statement to a source file. Skips exact duplicates. Places new imports after existing ones, or at the top of the file if none exist.
Use this when: You need to import something the file does not already reference.
Don't use this when: You're adding a single name to an existing multi-name
import statement like from X import a, b -> use add_import_name.
Example: import_text="from typing import Optional" # Python import_text="import { readFile } from 'fs';" # JS/TS import_text="#include <stdlib.h>" # C/C++
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| import_text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses key behaviors: duplicate skipping, placement after existing imports, and supports multiple languages via examples. Lacks mention of file modification guarantee or permissions, but given no annotations, it is quite transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections for when to use, when not, and examples. Could be slightly more concise, but overall efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers usage, behavior, and alternatives. With no output schema details in description but presence of output schema noted, the description is nearly complete. Could mention return behavior for completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must explain parameters. While import_text is illustrated with examples, file_path is not explicitly described. The examples partially compensate, but direct parameter descriptions are missing.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool adds import statements to source files, skips duplicates, and specifies placement. It explicitly distinguishes from the sibling add_import_name by describing when to use each.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit 'Use this when' and 'Don't use this when' guidelines, including a direct reference to the alternative tool add_import_name for multi-name imports. This helps the agent decide correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_import_nameA
Add a name to an existing named-import statement. Idempotent: skips if the name is already present.
Python (.py):
from <module> import a, bJS/TS:
import { a, b } from "<module>"
Use this when: The module is already imported via a named-import form and
you want to add another name to that existing statement.
Don't use this when: The import statement doesn't exist yet -> use
add_import. You want a default or namespace import (import Foo from ...
or import * as ns from ...) -> use add_import with the full line.
Example (Python): module="typing" name="Optional" Example (TS): module="./utils" name="baz"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| module | Yes | ||
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description declares idempotency ('skips if the name is already present'), which is a key behavioral trait. It also gives language-specific examples (Python, JS/TS). With no annotations, the description covers the essential safety property well, though it does not mention error conditions or side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, uses bullet points for language-specific syntax, and front-loads the core action and idempotency. Every sentence adds value, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity and the presence of an output schema (not shown), the description covers the main functionality, idempotency, and usage boundaries. It does not detail return values or error messages, but those may be in the output schema. Overall, it is sufficiently complete for this tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, and the description adds only minimal context beyond parameter names. Examples show plausible values (e.g., module='typing', name='Optional') but do not explain constraints, formats, or relationships between parameters. For 3 required string parameters, more guidance is expected.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: 'Add a name to an existing named-import statement.' It identifies the specific verb (add) and resource (import name), and distinguishes from sibling tools like 'add_import' and 'remove_import_name' by focusing on adding a single name to an existing import.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit when-to-use and when-not-to-use guidance, including alternative tools ('add_import') and scenarios (default vs. namespace imports). This helps the AI agent decide correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_keyA
Add a new key-value pair inside a dict-like container. Works for JSON objects, YAML mappings, TOML tables, AND Python module-level dict literals.
For JSON/YAML/TOML: parent_target is the dotted path to the parent (use "" for root). For Python (.py): parent_target is the module-level variable name (e.g. 'CONFIG'). value should be a literal source expression in the target file's syntax (e.g. JSON '"foo"' or '42'; Python '"foo"' or '42').
Use this when: The key does not exist yet and you want to add it.
Don't use this when: The key already exists -> use replace_value. You're
adding an item to a list/array -> use append_to_array.
Example (JSON): parent_target="dependencies" key="mcp" value='"^1.2.0"' Example (Python): parent_target="CONFIG" # module-level CONFIG = {...} key='"timeout"' # include quotes if key is a string literal value="30"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| parent_target | Yes | ||
| key | Yes | ||
| value | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description explains per-type behavior (e.g., parent_target for JSON vs Python) and syntax requirements for value. It does not cover error cases like missing parent_target, but overall is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections, but slightly verbose with repeated examples. Could be trimmed slightly without losing clarity. Still, every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all necessary aspects: purpose, parameters, usage rules, examples, and file-specific behavior. Output schema exists, so return values need no explanation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema lacks descriptions (0% coverage). The description compensates fully by explaining parent_target (dotted path vs variable), value (literal expression in target syntax), and key. Examples clarify usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool adds a key-value pair to dict-like containers in JSON, YAML, TOML, and Python files. It distinguishes itself from siblings like replace_value and append_to_array by specifying scenarios.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides when to use (key does not exist) and when not to use (key exists, or adding to array), and names alternative tools. This is exemplary guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_methodA
Add a new method at the end of a class body.
Use this when: You're adding a method to an existing class.
Don't use this when: You're adding a field/attribute -> use add_field. You're
adding a top-level function (not inside a class) -> use add_top_level.
Example: class_target="LRUCache" content=' def clear(self):\n self.items.clear()'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| class_target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the insertion position ('at the end of a class body') and provides an example showing indentation. However, it does not mention error handling or side effects (e.g., file modification).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: two lines of usage guidance plus a short example. Every sentence adds value, and the structure is easy to scan. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 required parameters and an output schema (not described here), the description covers the main action and provides a clear example. However, it lacks details on prerequisites (e.g., class must exist) and error scenarios. The example partially compensates.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%; the description compensates with an example that illustrates usage of all three parameters ('file_path', 'class_target', 'content') and their roles. No explicit parameter descriptions, but the example is sufficient for understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Add'), a clear resource ('method'), and location ('at the end of a class body'). It distinguishes from sibling tools like 'add_field' and 'add_top_level' by explicitly stating when not to use them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use ('adding a method to an existing class') and when not to use, naming alternative tools ('add_field', 'add_top_level'). Includes an example that clarifies typical usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_parameterA
Add a parameter to a function signature at position 'end' (default) or 'start'. Leaves the body untouched.
Use this when: You need to add one or two parameters without retyping the whole
signature.
Don't use this when: You need to replace the entire signature -> use
replace_signature. You also want to change the body -> use replace_function.
Example: target="LRUCache.get" parameter="default=None" position="end"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| parameter | Yes | ||
| position | No | end |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description notes that the body is left untouched and provides a default position. However, it does not disclose error conditions, permissions, or other side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with about five sentences, front-loads the main action, and includes a helpful example without unnecessary verbiage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity and the presence of an output schema, the description adequately covers usage, behavior, and examples, making it complete for effective tool selection.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema coverage, the description explains target, parameter, and position via example and default. It does not explain file_path, but covers 3 of 4 parameters meaningfully.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool adds a parameter to a function signature at a specified position, distinguishing it from siblings like replace_signature and remove_parameter.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly states when to use (adding one or two parameters) and when not to (replacing entire signature or changing body), and names alternative tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_top_levelA
Insert top-level content into the file: a function, class, constant, type
alias, or any other top-level statement. position controls placement:
"bottom" (default): append to end of file.
"top": insert after the preamble (package/imports/includes/leading comments, plus the Python module docstring if present) and before the first real declaration.
Use this when: You're adding any kind of top-level code. Use position="top"
when inserting multiple declarations at the top of a file without the
insert_before <target> reverse-order problem.
Don't use this when: You need placement relative to a specific symbol ->
use insert_before / insert_after. You're adding to a class body -> use
add_method / add_field. You're adding a line inside an existing
function body -> use prepend_to_body / append_to_body.
Example: content="def parse_version(text):\n return tuple(int(x) for x in text.split('.'))" content="class Logger:\n pass", position="top" content="MAX_CONNECTIONS = 10", position="top"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| content | Yes | ||
| position | No | bottom |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It explains position behavior (bottom default, top after preamble) and the reverse-order problem. However, it does not mention error handling or output format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections, bullet points, and examples. Every sentence adds value, but slightly lengthy for a concise description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers what the tool does, where content is placed, and when to use alternatives. Output schema exists, so return values need not be described. Lacks details on file validation and error cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%. Description explains the 'position' parameter thoroughly with examples and usage rationale, but 'file_path' and 'content' are only defined by type in schema, lacking additional context such as path requirements or content format.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Insert top-level content into the file' and lists specific types (function, class, constant, type alias), differentiating it from sibling tools like add_method or add_field.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides 'Use this when' and 'Don't use this when' sections, naming alternative tools (insert_before, insert_after, add_method, add_field, etc.) and specific scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
append_to_arrayA
Append a literal value to an array/list. Works for JSON arrays, YAML sequences, TOML arrays, AND Python module-level list literals.
For JSON/YAML/TOML: target is the dotted path to the array. For Python (.py): target is the module-level variable name (e.g. 'ITEMS').
Use this when: You want to add an item to a list (dependencies, keywords,
include paths, fixtures, etc.).
Don't use this when: You're adding a key-value pair -> use add_key.
Example (TOML): target="project.dependencies" value='"new-package"' Example (Python): target="ITEMS" value='"new-item"'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| value | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavior. It explains how 'target' works per format and gives examples, but does not cover side effects (e.g., file modification in place, duplicate handling, ordering) or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear first sentence, separate sections for formats, usage, and examples. It is informative but could be slightly more compact without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description covers essential aspects: formats, parameter interpretation, usage guidelines, and examples. It lacks some behavioral details, but overall is adequate for the task.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema description coverage, the description adds meaning for 'target' (dotted path vs variable name) and 'value' (literal string quoting). However, 'file_path' is left unexplained, though it is fairly self-explanatory.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it appends a literal value to an array/list, specifies supported formats (JSON, YAML, TOML, Python), and distinguishes itself from the sibling 'add_key' by explicitly noting when not to use it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit when-to-use ('add an item to a list') and when-not-to-use ('adding a key-value pair -> use add_key'), with a direct alternative mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_in_bodyA
Delete a byte-identical snippet inside a named function/method body. Scoped to the target's body so global file matches don't apply.
Raises if the snippet is not found, or if it appears more than once in the body (include more surrounding context to make the match unique).
Use this when: You want to remove a specific statement, block, or line
inside a function body without rewriting the whole body. Also useful for
removing a single entry from an inline object-literal passed as a function
argument -- target the enclosing function and delete the entry text.
Don't use this when: You're deleting the entire function/class -> use
delete_symbol.
Example (remove a mount call inside a function): target="RegisterRoutes" snippet='\tr.Mount("/kb", kbHandler)\n'
Example (remove a key from an inline object arg): target="main" snippet="\t\tclassification,\n"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| snippet | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses scope (target's body), raises on not-found or duplicate snippet, and advises adding context. Missing details on side effects (e.g., file modification) or permissions, but otherwise informative.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is concise (under 150 words) with clear sections. Examples are helpful but slightly redundant; could trim 'Don't use this' repetition. Still, front-loaded structure aids quick understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 required params, no annotations, and an output schema (not described), the description covers key behaviors (raises conditions, scoping), usage guidance, and examples. Does not explain return value or error handling beyond raises, but is sufficient for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% coverage (no descriptions), but the description explains parameters via examples: 'target' is the function/method name, 'snippet' is the byte-identical text. 'file_path' is not elaborated but is standard. Examples add meaning beyond schema names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the action (delete a byte-identical snippet), target (inside a named function/method body), and distinguishes from sibling delete_symbol by specifying deletion of an entire function/class. The verb 'delete' and resource 'snippet inside function body' are 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.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides 'Use this when' and 'Don't use this when' sections, including an alternative (delete_symbol). The examples give concrete scenarios (removing a mount call, removing a key from an inline object arg), guiding effective use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_keyA
Delete a key-value pair from a dict-like container.
JSON / YAML / TOML: dotted path to the key.
Python (.py) module-level dict literals: target is 'DictName.keyExpr' (e.g. 'CONFIG."timeout"').
JS / TS module-level
const/let/varobject literals (includingexport const ... = { ... }): target is 'VarName.keyName' or 'VarName."quoted-key"'. Handles both regular{ key: value }pairs and shorthand{ key }properties.
For JSON and JS/TS, the adjacent comma is also removed to keep the file valid.
Use this when: You want to remove an entire entry.
Don't use this when: You want to remove an item from a list/array -> use
remove_from_array. You need to edit an inline object literal passed as a
function argument (foo({ x })) -- use delete_in_body (Phase 3) scoped
to the enclosing function instead.
Example (JSON):
target="dependencies.tree-sitter"
Example (Python):
target='CONFIG."timeout"'
Example (TS):
target="CONFIG.port" # regular pair
target="CONFIG.name" # shorthand { name }
target='CONFIG."complex-key"' # quoted key
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes the deletion action and comma removal for JSON/JS/TS, but does not explicitly state that the file is modified in place or that the action is irreversible. With no annotations, the burden is on the description, and it largely meets it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections, examples, and usage guidelines. Every sentence adds value, no unnecessary repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers all relevant aspects: operation, file types, usage context, examples. Output schema exists so return value explanation is not needed. Complete for the given complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description thoroughly explains the 'target' parameter with file-specific syntax and examples. 'file_path' is not explained, though its purpose is somewhat obvious. Overall, adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it deletes a key-value pair from dict-like containers, with specific file type support and examples. It distinguishes from siblings like remove_from_array and delete_in_body.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (remove an entire entry) and when not to use (list removal -> remove_from_array, inline object -> delete_in_body), with alternative tool names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_symbolA
Delete an entire function or class definition, including its decorators.
By default, also removes the contiguous leading comment block above the
symbol (Godoc, Javadoc /** ... */, # or // comment runs) so the
doc doesn't become orphaned floating text. Pass
include_leading_comments=False to leave that comment in place.
Use this when: You want to remove a function, method, or class entirely from a
source file -- along with its doc comment by default.
Don't use this when: You want to remove a config key -> use delete_key. You
want to remove an import -> use remove_import. You want to remove lines
inside a function -> use delete_in_body (or replace_function_body to
rewrite the whole body without the unwanted lines).
Example: target="LRUCache.old_method" # deletes a method + its leading comment target="DeprecatedClass" # deletes class, all methods, and preceding Javadoc target="Foo", include_leading_comments=False # keep the comment, delete only the symbol
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| include_leading_comments | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes default behavior of removing leading comment and the option to keep it. Explains rationale (avoid orphaned doc). No annotations provided, so description takes full responsibility. Could mention error handling or idempotency, but sufficient for a delete operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured: concise first sentence, then details, then usage guide, then examples. Every sentence adds value. Could slightly reduce length, but it's efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and an output schema (not shown), the description covers essential behavior, usage guidelines, and parameter hints. Lacks explicit return value info but output schema presumably handles that. Good for a delete tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage, so description must compensate. It gives examples of target syntax (e.g., 'LRUCache.old_method') and explains include_leading_comments, but file_path is not described. Compensates partially but lacks explicit format guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it deletes a function or class definition including decorators. Explicitly distinguishes from sibling tools like delete_key, remove_import, and delete_in_body in the usage guidelines.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit 'Use this when' and 'Don't use this when' sections with alternative tool names. Examples further clarify appropriate usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_leading_commentA
Edit the contiguous leading-comment block above a named symbol. One tool covering three operations on the same comment block.
Supported values for op:
"add": Insert a new comment block above the symbol. Requires
comment. Raises if a leading comment already exists and would be pushed down as a separate block."replace": Replace the existing leading comment block with
comment; if no leading comment exists, inserts one. Requirescomment."remove": Delete the existing leading comment block.
commentis ignored.
The comment must include the language's comment marker (# for
Python/Ruby/YAML/TOML, // or /* ... */ for JS/TS/C/C++/Go/Java,
/** ... */ Javadoc for Java). Supports multi-line C-style block
comments as a single contiguous run.
Use this when: You want to document, update, or delete a leading
comment on a function/class/method.
Don't use this when: You want a Python docstring (which lives inside
the function body) -> use replace_docstring. You want to edit text
inside the function body itself -> use replace_in_body.
Example: target="LRUCache.get", op="add", comment=" # Retrieve an item by key, returning None if absent"
target="LRUCache.get", op="replace",
comment=" # Retrieve an item from the cache"
target="LRUCache.get", op="remove"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| op | Yes | ||
| comment | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It details behavior for each op: add raises if comment exists, replace inserts if none, remove ignores comment. Also notes comment marker requirements. Misses potential error conditions or idempotency, but covers core behavior well.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Reasonably concise given the three-operation scope. Structured with sections for op details, comment syntax, usage guidelines, and examples. Each sentence adds value, though could be slightly trimmed without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present, description doesn't need return value details. Covers operation semantics, comment syntax prerequisites, and usage conditions. Does not mention concurrency or performance, but acceptable for a single-file editing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description thoroughly explains 'op' with three enumerated values and their semantics. Requires 'comment' only for add/replace, demonstrated in examples. Lacks detail on 'file_path' and 'target' formats, but examples and context imply they follow symbol naming conventions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool edits the contiguous leading-comment block above a named symbol, with three operations (add/replace/remove). Distinguishes from sibling tools like replace_docstring and replace_in_body by explicitly contrasting use cases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says when to use ('You want to document, update, or delete a leading comment') and when not to use ('You want a Python docstring' -> use replace_docstring; 'edit text inside the function body' -> use replace_in_body). Provides clear alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_referencesA
Return all occurrences of an identifier named target in a source file, as
'line N: '. Read-only, syntactic only (no scope awareness), so
results may include unrelated identifiers that happen to share the same name.
Use this when: You're about to rename or refactor a symbol and need a quick survey of where it appears in the file. Don't use this when: You need cross-file or scope-aware analysis -> use a full language server.
Example: target="LRUCache"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses read-only, syntactic-only, no scope awareness, and potential for unrelated results. Also describes output format. With no annotations, description fully covers behavioral aspects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise, front-loaded with purpose, then limitations, usage guidelines, and example. 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.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the description adequately covers usage context, behavioral nuances, and parameter semantics. It is complete for this simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema description coverage, the description explains the 'target' parameter with an example and implies 'file_path' as the source file. However, file_path is not explicitly described, and the example omits it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns occurrences of an identifier in a source file as line entries, distinguishes from sibling code manipulation tools, and explains its syntactic-only nature.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (renaming/refactoring a symbol for quick survey) and when not to use (cross-file or scope-aware analysis), with a clear alternative (full language server).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
insert_in_bodyA
Insert new_snippet inside a named function/method body. Pass EXACTLY ONE
of at, after, or before -- this one tool covers four placement
modes that used to be spread across three separate tools.
at="top": insert at the top of the body.
at="bottom": insert at the bottom of the body.
after=: insert immediately after a byte-identical anchor.
before=: insert immediately before a byte-identical anchor.
The anchor match (for after/before) is scoped to the target's body
and must be unique -- multiple matches raise an error telling you to
include more surrounding context. Caller is responsible for any
leading/trailing newlines and indentation in new_snippet.
Use this when: You're inserting new lines into a function body. Use
at="top"/at="bottom" for simple prepend/append, or after/before
for anchored insertion.
Don't use this when: You're replacing the whole body -> use
replace_function_body. You're adding a top-level symbol -> use
add_top_level. You're changing an existing snippet in the body ->
use replace_in_body.
Example (prepend): target="handle" new_snippet=' log("start")\n' at="top"
Example (append): target="handle" new_snippet=' log("end")\n' at="bottom"
Example (after anchor): target="handle" new_snippet=' metrics.incr("calls")\n' after=' validate(request)\n'
Example (before anchor): target="handle" new_snippet=' auth_check(request)\n' before=' validate(request)\n'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| new_snippet | Yes | ||
| after | No | ||
| before | No | ||
| at | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses key behaviors: only one of at/after/before can be used, anchor match must be unique, error on multiple matches, caller responsible for formatting. Does not cover auth or rate limits but is comprehensive for the tool's scope.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with bullet points and examples. Front-loaded with main purpose and constraints. Every sentence adds value, no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (4 placement modes, 6 parameters), the description covers all necessary context: placement semantics, constraints, examples, and output schema existence. No major gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description compensates by explaining each parameter (file_path, target, new_snippet, at, after, before) with detailed semantics and examples, adding significant value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: inserting a snippet inside a function/method body with four placement options. It distinguishes itself from siblings by naming alternative tools like replace_function_body and add_top_level.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to use this tool (inserting into function body) and when not to (replacing body, adding top-level symbol, changing existing snippet), with named alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
insert_siblingA
Insert content as a sibling of a named symbol (function, class, method,
or top-level assignment). Pass position="before" or position="after".
Use this when: You need precise placement relative to another top-level
symbol -- e.g. a helper function immediately before its caller, a
constant immediately above the class that uses it.
Don't use this when: You just want to append to the end of the file ->
use add_top_level. You're inserting inside a function body ->
use insert_in_body (with at, after, or before).
Example: target="LRUCache" content="CACHE_SIZE = 100" position="before"
target="LRUCache"
content="RELATED_CONSTANT = 42"
position="after"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes | ||
| position | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral traits. It explains basic operation (inserting a sibling at a specified position) and the types of symbols covered. However, it lacks details on side effects (e.g., ordering of multiple siblings), error handling (e.g., target not found), or reversibility, which is insufficient for a tool without annotation support.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two succinct paragraphs plus an example. Every sentence adds value: first sentence states purpose, second provides usage guidelines and alternatives, and the example demonstrates typical usage. No redundant or unnecessary content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of the tool (4 required parameters, many sibling tools), the description covers essential aspects: purpose, usage criteria, alternatives, and an example. It does not describe the output schema, but that is not required. The only minor gap is lack of parameter semantics for all parameters, but overall it provides sufficient context for an agent to use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% parameter description coverage. The description adds meaning for the 'position' parameter (before/after) and 'target' (named symbol). It also clarifies 'content' via examples. However, 'file_path' and the exact format of 'target' and 'content' are not explicitly defined. While it improves upon the bare schema, it does not fully compensate for the lack of parameter descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool inserts content as a sibling of a named symbol, specifying position options 'before' or 'after'. It differentiates from sibling tools by naming alternatives like add_top_level and insert_in_body, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly provides when-to-use scenarios (precise placement relative to a top-level symbol) and when-not-to-use scenarios (appending to end of file -> use add_top_level; inserting inside function body -> use insert_in_body). It names specific alternative tools, offering clear guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_symbolsA
Return a formatted outline of all top-level functions, classes, and methods in a source file (Python, JS, TS, C, C++), with line numbers. Read-only.
Use this when: You're about to edit an unfamiliar file and want to see its structure and exact symbol names. ALWAYS a good first call before editing -- avoids guessing at target names. Don't use this when: You already know the exact target name.
Example: file_path="/abs/path/to/module.py"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It declares the operation as read-only, which is critical. It doesn't elaborate on side effects or permissions, but given the simplicity of a list operation, this is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loads the action, and uses a clear structure: what it does, usage guidance, and an example. 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.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists (not shown but indicated), the description doesn't need to detail return values. It covers purpose, parameter semantics, usage context, and read-only nature, making it fully adequate for this simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must compensate. It provides an example path and lists supported languages. However, it lacks details on path format (absolute vs relative) or validation rules, leaving some ambiguity for the agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns a formatted outline of top-level symbols from supported source files with line numbers. It distinguishes itself from sibling tools like 'read_symbol' by specifying it lists all symbols rather than reading a specific one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly provides when to use (before editing an unfamiliar file) and when not to use (when exact target name is known), positioning it as a best practice first call. This directly helps the agent choose among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_importsA
Return all import statements in a source file as a multi-line string. Read-only.
Use this when: You need to see a file's dependencies without reading the entire
file (e.g. before adding a new import, or to understand what a module uses).
Don't use this when: You want to add/remove imports -> use add_import /
remove_import.
Example: file_path="/abs/path/to/module.py"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden and explicitly states 'Read-only', implying no modification. It details the return format as a multi-line string, but lacks specifics on error handling or file existence behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, using bullet points and an example, with no unnecessary words. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with a simple return type, the description covers purpose, usage, return format, and provides an example. It is complete given the presence of an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description adds meaning. It explains the parameter 'file_path' through context and an example, clarifying its role as the file path to the source module.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Return all import statements in a source file as a multi-line string' with a clear verb and resource, and also notes 'Read-only', distinguishing it from sibling tools like add_import and remove_import.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit 'Use this when' and 'Don't use this when' sections provide clear context and alternatives (add_import and remove_import), guiding correct selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_symbolA
Return source text for a single named symbol (function, class, method, config key) without reading the entire file. Read-only.
depth controls how much is returned:
"full" (default): Entire source of the symbol. Typical savings: 10-20x fewer tokens than reading the whole file.
"interface": For a class -> header + field declarations + method signatures with bodies replaced by ' ...'. For a function -> just the signature.
"signature": Signature-only. For a function -> the line(s) before the body. For a class -> the class header.
Use this when: You need to read a specific symbol without reading the
whole file. Pick the narrowest depth that contains what you need.
Don't use this when: You need a structural overview of the whole file
-> use list_symbols. You need to see the file's imports -> use
read_imports.
Example: target="LRUCache.get" # full method source target="LRUCache", depth="interface" # class skeleton target="LRUCache.get", depth="signature" # just the def line target="project.version" # config value
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| depth | No | full |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose behavior. It declares the tool as 'Read-only' and explains the three depth options in detail, including what each returns for different symbol types. Examples illustrate typical usage, ensuring the agent understands the tool's behavior and token savings.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections, bullet points, and a separate example list. It is front-loaded with the core purpose, then details depth options, usage guidelines, and concrete examples. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that the tool has three parameters and an existing output schema (so return values don't need explanation), the description covers all necessary aspects: purpose, when to use vs. alternatives, depth semantics, and examples. It is complete for an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description must compensate. It thoroughly explains the 'depth' parameter with semantic meaning and default value. However, the 'file_path' and 'target' parameters are not explicitly described; their meaning is only implied through examples. While the examples are helpful, a direct explanation of what 'target' represents (e.g., 'a dot-separated path to a symbol') would improve clarity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with 'Return source text for a single named symbol', which is a specific verb+resource. It explicitly differentiates from siblings by stating what it does not do (e.g., 'without reading the entire file') and contrasts with list_symbols and read_imports for different use cases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance: 'Use this when: You need to read a specific symbol...' and 'Don't use this when: You need a structural overview... use list_symbols. You need to see the file's imports... use read_imports.' It also recommends picking the narrowest depth.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
remove_from_arrayA
Remove the first element matching value_match (stripped text equality) from an array/list. Works for JSON/YAML/TOML config arrays AND Python module-level list literals.
For JSON/YAML/TOML: target is the dotted path to the array. For Python (.py): target is the module-level variable name.
Use this when: You want to remove a specific item from a list.
Don't use this when: You want to remove a whole key -> use delete_key.
Example (TOML): target="project.dependencies" value_match='"old-package"' Example (Python): target="ITEMS" value_match='"old-item"'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| value_match | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Covers the core behavior: removes first matching element, works for multiple file types, uses stripped equality. Lacks explicit mention that it modifies the file. No annotations to contradict.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with clear paragraphs, usage guidelines, and examples. Slightly verbose but efficient for the complexity covered.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Provides enough detail for a complex tool, missing only explicit file_path explanation and side-effects. Output schema exists to cover return values, reducing burden.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Explains target and value_match well, including examples. But file_path is not described anywhere in the description, leaving a gap for 0% schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Explicitly states it removes the first element matching value_match from an array/list. Distinguishes from sibling delete_key (removes whole key) and append_to_array. Specifies stripped text equality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit 'Use this when' and 'Don't use this when' guidance, naming the alternative tool (delete_key). Clearly defines the context of use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
remove_importA
Remove a matching import statement from a source file. Matching is by stripped text equality -- pass the exact import line you want to remove.
Use this when: You want to remove an unused import.
Don't use this when: You want to remove one name from a multi-name import -> use
remove_import_name.
Example: import_text="import os"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| import_text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description explains matching logic but does not mention side effects (file modification), error behavior, permissions, or return values. Critical behavioral aspects are missing.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise: a few sentences covering purpose, usage guidelines, and an example. No redundant information. Front-loaded with the main action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Low parameter count and has output schema. Description covers purpose and usage but lacks behavioral details like modification effects, error handling, or return type. Adequate but with gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage. Description adds meaning: file_path is the source file, import_text is the exact line (stripped). Example clarifies format. However, it omits file_path constraints (e.g., relative/absolute path).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (remove), resource (import statement), and context (from source file). It also explains matching logic and differentiates from remove_import_name, which is a sibling tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (remove unused import) and when not to use (remove one name from multi-name import), including the alternative tool name remove_import_name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
remove_import_nameA
Remove a name from a named-import statement.
Python (.py):
from <module> import a, b, cJS/TS:
import { a, b, c } from "<module>"
If the name removed is the only remaining one AND there are no other
bindings (default / namespace) in the same statement, the entire import
line is removed. Raises an error if removing the last name would leave
an invalid import Default, {} from "mod" fragment.
Use this when: You want to remove a single name from a multi-name import.
Don't use this when: You want to remove the entire import line -> use
remove_import.
Example (Python): module="typing" name="List" Example (TS): module="./utils" name="bar"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| module | Yes | ||
| name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses edge cases: automatic removal of the entire import line when the last name is removed and no other bindings exist, and error on invalid fragment. Since no annotations are provided, this adds necessary behavioral context. Minor omission: doesn't specify whether the operation requires file write permissions or is reversible.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, structured with bullet points and an example block. The main action is stated first, and every sentence adds value. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple input schema (3 required params) and the existence of an output schema (so return values are documented), the description provides sufficient context: behavior, edge cases, examples, and usage guidance. It is complete for an agent to use this tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description provides concrete examples (Python and TS) that clarify the 'module' and 'name' parameters. However, 'file_path' is not explained, and the description lacks explicit definitions for each parameter. The examples partly compensate but not fully.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool removes a name from a named-import statement, with language-specific examples. It explicitly distinguishes from the sibling 'remove_import' by contrasting single-name removal vs. entire line removal.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit 'Use this when' and 'Don't use this when' instructions, naming the alternative tool 'remove_import'. This helps the agent select the correct tool for the task.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
remove_parameterA
Remove a parameter by name from a function signature. Leaves the body untouched.
Use this when: You need to remove one parameter without retyping the whole
signature.
Don't use this when: You need to replace the whole signature -> use
replace_signature.
Example: target="LRUCache.get" parameter_name="default"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| parameter_name | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description adequately conveys the tool's behavior: removes a parameter and leaves the body untouched. It does not discuss error cases like missing parameter, but the example is clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences plus an example, front-loaded with purpose, followed by usage guidelines. No redundant information; every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity, the description covers the main use case and provides an example. It does not explicitly state that the tool modifies the file, but that is implied. Output schema exists, so return values are not required.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%. The description provides example values for target and parameter_name, but does not explain file_path or the format of target. It adds some meaning but not comprehensive.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the action (remove a parameter), the resource (function signature), and what it does not do (leaves body untouched). Example further clarifies usage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (remove one parameter) and when not to use (replace whole signature) with a direct sibling alternative (replace_signature).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_docstringA
Replace or insert a Python docstring on a function or class. Python-only. The new_docstring should be a valid Python string literal including its surrounding triple quotes.
Use this when: You want to add or update a Python docstring without touching
the function body.
Don't use this when: You're editing a # comment above the symbol -> use
replace_leading_comment. You're in a non-Python file -> no equivalent tool.
Example: target="LRUCache.get" new_docstring=(triple-quoted string, e.g. with three double-quotes before and after the summary text)
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| new_docstring | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It describes the operation as replace/insert, implicitly a write action, and specifies the new_docstring must be a valid Python string literal with triple quotes. However, it lacks explicit mention of overwriting behavior or error conditions, though the core behavior is clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is succinct with about 5 sentences plus an example, no fluff. Well-structured: purpose, format note, usage guidelines, example. Every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters and an output schema (which likely covers return info), the description covers purpose, format, when-to-use, and differentiation. It lacks explanation of file_path but that is typical. Almost complete for a focused editing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must explain parameters. It explains target (function/class name with example) and new_docstring (must be valid Python string literal with triple quotes). file_path is not explained but is standard. This adds meaning beyond the schema's type-only definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool replaces or inserts a Python docstring on a function or class, and specifies it is Python-only. It distinguishes from sibling tools like replace_leading_comment and indicates no equivalent for non-Python files.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (add/update docstring without touching body) and when not to use (editing # comment above, use replace_leading_comment; non-Python files have no equivalent). Provides clear context for alternative selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_functionA
Replace an entire function definition with new content -- signature, body, and decorators.
Use this when: You're rewriting a function top-to-bottom (e.g., renaming it,
changing parameters AND implementation together).
Don't use this when: You only need to change the body -> use replace_function_body.
You only need to change the signature -> use replace_signature.
Example: target="LRUCache.get" content=' def get(self, key, default=None):\n return self.items.get(key, default)'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It describes the operation but lacks details on error handling, idempotency, or side effects. Acceptable but not exemplary.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise and well-structured: purpose, usage guidelines, and example in few sentences without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given low schema coverage and no annotations, the description covers purpose and usage well. Missing parameter descriptions, but overall sufficient for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%. The description partially compensates via an example that explains 'target' and 'content' but does not describe 'file_path'. Adequate but incomplete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('replace') and resource ('function definition'), and clearly distinguishes from sibling tools like replace_function_body and replace_signature.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (top-to-bottom rewrite) and when not to use (e.g., only body change -> use replace_function_body), with an example.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_function_bodyA
Replace only the body of a function, preserving its signature and decorators.
Use this when: You're changing the implementation while keeping the interface stable.
Don't use this when: You're also changing parameters or return type -> use
replace_signature or replace_function.
Example: target="LRUCache.get" content=' if key in self.items:\n return self.items[key]\n return None'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so description carries full burden. It clearly states what is preserved (signature, decorators) but does not mention error handling or side effects like file modification.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise, well-structured: clear purpose, usage guidelines, and a concrete example. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations and 0% schema coverage, the description covers core behavior and usage. However, it omits details on file_path, error cases, and return value, though an output schema exists and could be referenced.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% (no descriptions in schema), but the parameter names are self-explanatory. The description provides an example that illustrates usage of target and content, partially compensating for lack of formal definitions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Describes the tool with a specific verb 'replace' and resource 'body of a function', and distinguishes from siblings like replace_function and replace_signature by specifying it preserves signature and decorators.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use ('changing the implementation while keeping interface stable') and when not to use ('changing parameters or return type') with specific alternative tools mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_in_bodyA
Replace a byte-identical snippet inside a named function/method body, without touching the surrounding code. The match is scoped to the target's body so accidental matches elsewhere in the file cannot happen.
Raises if the snippet is not found, or if it appears more than once in the body (include more surrounding context to disambiguate).
Use this when: You need to change a specific statement or block inside a
large function body without rewriting the whole body. The single biggest
token-saver for long functions with ~30 similar lines where you only want
to change one of them.
Don't use this when: You're replacing the entire body -> use
replace_function_body. You need to change a sub-expression inside a
method chain that string matching can't uniquely locate -> use the default
Edit tool instead.
Example: target="init" old_snippet="viper.BindPFlag("port", cmd.Flags().Lookup("port"))" new_snippet="viper.BindPFlag("port", cmd.PersistentFlags().Lookup("port"))"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| old_snippet | Yes | ||
| new_snippet | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses scoping to the target's body and error behavior. However, it does not mention return value, side effects beyond replacement, or authentication/permissions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with separate sections for purpose, usage guidance, and an example. Each sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity and lack of schema parameter descriptions, the description covers scoping, error conditions, and usage context. It does not explain the output schema, but that is acceptable per rules. Slight gap in parameter semantics for file_path.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% with no parameter descriptions. The example illustrates target, old_snippet, and new_snippet, but file_path is not explained. Agents must infer from parameter names, which is insufficient for clarity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it replaces a byte-identical snippet inside a named function/method body, scoped to avoid accidental matches elsewhere. It distinguishes from sibling tools like replace_function_body and includes an example.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly describes when to use (changing a specific statement inside a large function body) and when not to use (entire body -> replace_function_body, ambiguous sub-expression -> default Edit tool). Also notes error conditions for multiple/not found snippets.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_signatureA
Replace only the signature of a function, preserving its body and decorators.
Use this when: You're changing parameters, return type, or function name
without modifying the implementation.
Don't use this when: You also want to change the body -> use replace_function.
You're adding/removing one parameter -> use add_parameter/remove_parameter.
Example: target="LRUCache.get" new_signature=" def get(self, key, default=None):"
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| new_signature | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description discloses that it preserves body and decorators, a key behavioral trait. With no annotations, it provides an example but could mention potential side effects like file modification. Still, it is informative.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is compact: one sentence for purpose, one for usage guidelines, and an example. No redundancy, well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 3 params and no annotations, the description covers usage and provides an example. Output schema exists to explain return values. Could mention return value or error handling, but overall sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 3 required params with 0% description coverage. Description adds value through an example showing target format (function path) and new_signature (Python code with indentation). Does not explicitly describe file_path, but it's self-explanatory.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Replace only the signature of a function', specifying verb and resource. It distinguishes from siblings like replace_function and add_parameter by explicitly naming them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (changing parameters, return type, function name) and when not to (changing body -> use replace_function, adding/removing one parameter -> use add_parameter/remove_parameter). Provides clear guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
replace_valueA
Replace the value of an existing key in a JSON, YAML, or TOML file.
Use this when: A key already exists and you want to update its value.
Don't use this when: The key doesn't exist yet -> use add_key. You're modifying
an array -> use append_to_array or remove_from_array.
Example: target="project.version" content='"2.0.0"'
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| target | Yes | ||
| content | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description indicates it replaces a value (implied mutation) but does not disclose potential side effects like file backup, error handling for missing files, or formatting preservation. With no annotations, it partially covers behavioral traits but lacks depth.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences plus a focused example. No unnecessary words, efficiently conveys core information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers main use case and boundaries. Output schema is present, so return values are likely documented externally. Missing details like error handling or file validation, but overall adequate for a simple replace tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 0% description coverage, so description must explain parameters. It provides an example clarifying target (dot-separated path) and content (new value with quotes) but does not explain file_path. Adds moderate meaning beyond schema but incompletely compensates.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Replace the value of an existing key' and specifies file types (JSON, YAML, TOML). It distinguishes from siblings like add_key and array operations, making the tool's purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly tells when to use (key exists, update value) and when not to use (key missing -> add_key, array modification -> append_to_array/remove_from_array). Provides clear alternatives for each exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
28 tool updates
v2.0.1- First observed
add_field - First observed
add_import - First observed
add_import_name - First observed
add_key - First observed
add_method - First observed
add_parameter - First observed
add_top_level - First observed
append_to_array - First observed
delete_in_body - First observed
delete_key - First observed
delete_symbol - First observed
edit_leading_comment - First observed
find_references - First observed
insert_in_body - First observed
insert_sibling - First observed
list_symbols - First observed
read_imports - First observed
read_symbol - First observed
remove_from_array - First observed
remove_import - First observed
remove_import_name - First observed
remove_parameter - First observed
replace_docstring - First observed
replace_function - First observed
replace_function_body - First observed
replace_in_body - First observed
replace_signature - First observed
replace_value
TDQS
Each tool has a clearly distinct purpose with detailed descriptions that avoid overlap. Even similar tools like `replace_function` vs `replace_function_body` are well-differentiated by their scope.
All tools follow a consistent verb_noun pattern in snake_case (e.g., add_field, delete_symbol, replace_value), making it easy to predict tool names.
28 tools is on the higher side but appropriate for a comprehensive AST editor covering many fine-grained operations. The count is still manageable with clear naming.
The tool set covers a wide range of code editing needs: adding, deleting, replacing, and reading symbols, bodies, imports, comments, and config files. Minor gaps exist (e.g., no rename tool) but core workflows are well-supported.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
A MCP server built for developers enabling Git based project management with project and personal…
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
251
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA runtime-free MCP server that converts source code into AST🌲, regardless of language.86MIT
- AlicenseBqualityDmaintenanceAdvanced code search and transformation MCP server for AI assistants. Combines ugrep's speed with intelligent replace capabilities, dry-run previews, and language-aware refactoring across 11 tools.110MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to search and analyze codebases using Abstract Syntax Tree (AST) pattern matching with ast-grep. Supports structural code search, pattern testing, and AST visualization across multiple programming languages.4456MIT
- AlicenseNot gradedqualityDmaintenanceProvides advanced code structure and semantic analysis through Abstract Syntax Trees (AST) and Abstract Semantic Graphs (ASG) across multiple programming languages. It enables tasks like incremental parsing, complexity analysis, and AST diffing to help models understand and navigate codebases.36MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/kambleakash0/ast-editor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server