ast-editor
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| replace_functionA | Replace a whole symbol (decorators, signature and body) with new content.
The replaced span is what read_symbol returns: decorators, a JS/TS
Use this when: rewriting a symbol top to bottom (name, parameters and body). Don't use this when: only the body changes (replace_function_body), only the signature (replace_signature), or a few lines (replace_in_body). Example: target="LRUCache.get" content='def get(self, key, default=None):\n return self.items.get(key, default)' |
| replace_function_bodyA | Replace only the body of a function, keeping its signature and decorators. A body on its signature's line is rebuilt over lines of its own, and an empty body gets content one level deeper than the function. A Ruby method's rescue, else and ensure clauses stay and only the code before them is replaced, unless content has clauses of its own. Refused for a function without a block body: a Ruby endless method, or an arrow function whose body is an expression (use replace_function). Use this when: changing the implementation but not the interface. Don't use this when: the parameters or return type change too (replace_function), or only a few lines change (replace_in_body). Example: target="LRUCache.get" content='if key in self.items:\n return self.items[key]\nreturn None' |
| replace_in_bodyA | Replace a snippet inside a function's body; the match is scoped to that body, so text elsewhere in the file never matches. A snippet found nowhere is refused; one found in several places is refused with their line numbers: add context. Use this when: changing one statement or block in a long body. Don't use this when: replacing the whole body (replace_function_body), or editing a sub-expression no unique snippet can locate (your normal edit tool). Example (a block written without its indentation): target="handle" old_snippet="if retry:\n wait()" new_snippet="if retry:\n backoff()\n wait()" |
| delete_in_bodyA | Delete a snippet inside a function's body, matched as replace_in_body
matches one. A deletion that empties its lines removes them whole; a
comment after the snippet on its last line stays. One that would leave
a Python body without a statement is refused (replace the snippet with
Use this when: removing a statement, block or line in a body, or an entry of an object literal passed as an argument. Don't use this when: deleting a whole function or class (delete_symbol). Example: target="RegisterRoutes" snippet='r.Mount("/kb", kbHandler)' |
| insert_in_bodyA | Insert new_snippet inside a function's body. Set exactly one of An anchor is matched as replace_in_body matches a snippet and must be
unique. One that ends its line (after) or starts it (before) gets
new_snippet on lines of its own; after a line that opens a block ( Use this when: adding lines to a body. Don't use this when: replacing the whole body (replace_function_body), changing existing lines (replace_in_body), or adding a top-level symbol (add_top_level). Example (both written without indentation): target="handle" new_snippet='auth_check(request)' before='validate(request)' |
| add_methodA | Add a method at the end of a class body, after its last member, spaced like the class's methods. In Go it goes after the type declaration. In a C++ class whose last method is followed by an access label, it goes right after that method, so it gets the same access. A one-line Python or Ruby class is refused, and so is a function target (use insert_in_body). Use this when: adding a method to an existing class. Don't use this when: adding a field (add_field) or a top-level function (add_top_level). Example: class_target="LRUCache" content='def clear(self):\n self.items.clear()' |
| delete_symbolA | Delete a whole function, method, class or other symbol, with its
decorators, a JS/TS Use this when: removing a symbol along with its doc comment. Don't use this when: removing a config key (delete_key), an import (remove_import) or lines inside a body (delete_in_body). Example: target="LRUCache.old_method" |
| replace_valueA | Replace the value of an existing config key, dict or object entry, or
of a variable, constant, field or macro in a source file ( Use this when: updating a value that exists. Don't use this when: the key is new (add_key), or you edit an array (append_to_array, remove_from_array). Example: target="project.version" content='"2.0.0"' |
| add_importA | Add an import line, skipping an exact duplicate. It goes into the group
of imports it belongs with (same package, standard library or not,
relative or not), at its sorted place when the group is sorted, else
after the group's last import. A comment heading the group stays first
(a next-line directive stays on its import), and so do Python Use this when: importing something the file does not import yet. Don't use this when: adding a name to an existing import (add_import_name). Example: import_text="from typing import Optional" |
| remove_importA | Remove an import line, matched by its text with surrounding whitespace stripped. Use this when: removing an unused import. Don't use this when: removing one name from a multi-name import (remove_import_name). Example: import_text="import os" |
| add_keyA | Add a key-value pair to a JSON object, YAML mapping, TOML table, Python dict literal or JS/TS object literal. The entry follows the container's layout: one key per line stays so, an inline object stays inline, and a trailing comma is kept. A YAML key with no value gets a nested mapping. A key the container already has is refused, naming the target to give replace_value. Use this when: the key does not exist yet. Don't use this when: the key exists (replace_value), or you add a list item (append_to_array). Example (TS, const CONFIG = { server: {...} }): parent_target="CONFIG.server" key="port" value="8080" |
| delete_keyA | Delete a key-value pair from a config file, or from a Python or JS/TS
module-level dict or object literal. The adjacent comma goes too where
the syntax has one, and deleting the only entry leaves Use this when: removing a whole entry. Don't use this when: removing a list item (remove_from_array), or an entry of an object literal passed as an argument (delete_in_body). Example: target='CONFIG."timeout"' |
| append_to_arrayA | Append a value to a JSON, YAML or TOML array or a Python module-level
list. The value follows the array's layout: an inline array stays
inline ( Use this when: adding a list item. Don't use this when: adding a key-value pair (add_key). Example: target="project.dependencies" value='"new-package"' |
| remove_from_arrayA | Remove the first element matching value_match from a JSON, YAML or
TOML array or a Python module-level list. An element on a line of its
own goes with that line and its comment; other comments stay. The
trailing-comma style is kept, and removing the only element leaves
Use this when: removing one list item. Don't use this when: removing a whole key (delete_key). Example: target="project.dependencies" value_match='"old-package"' |
| add_fieldA | Add a field or member at the top of a class body: before the first
member, after a Python class docstring or a Java enum's constants
(adding the Use this when: adding a class attribute, field or member variable. Don't use this when: adding a method (add_method). Example: class_target="LRUCache" content='version = "1.0"' |
| replace_signatureA | Replace the signature of a function, or the header of a class, keeping
its body. Existing decorators, Java annotations and a C++ Use this when: changing a function's parameters, return type or name. Don't use this when: the body changes too (replace_function), or one parameter is added or removed (add_parameter, remove_parameter). Example: target="LRUCache.get" new_signature="def get(self, key, default=None):" |
| list_symbolsA | List the symbols of a source file, one per line as Use this when: before editing a file, to get exact target names. Don't use this when: you already know the target (read_symbol reads one symbol). Example: file_path="/abs/path/to/module.py" |
| add_import_nameA | Add a name to an existing Use this when: the module is already imported with named imports. Don't use this when: there is no such import yet, or for a default or namespace import (add_import with the full line). Example ( |
| remove_import_nameA | Remove one name from a Use this when: dropping one name from a multi-name import. Don't use this when: removing the whole import line (remove_import). Example: module="typing" name="List" |
| add_parameterA | Add one parameter to a function's signature, keeping the body. "end"
puts it after the last parameter but before those that must come after
it (Python Use this when: adding a parameter without retyping the signature. Don't use this when: rewriting the signature (replace_signature), or changing the body too (replace_function). Example ( |
| remove_parameterA | Remove a parameter by name from a function's signature, keeping the
body. A parameter on a line of its own goes with that line and its
comment. Removing the only one leaves Use this when: dropping one parameter without retyping the signature. Don't use this when: rewriting the signature (replace_signature). Example: target="LRUCache.get" parameter_name="default" |
| replace_docstringA | Replace or add the docstring of a Python function, method or class, or
of the module with target "". new_docstring must be one string literal
with its quotes; anything else (bare text, an f-string, bytes, an empty
value) is refused. A new docstring goes first in the body; the module's
goes below a Use this when: adding or updating a Python docstring.
Don't use this when: editing a Example: target="LRUCache.get" new_docstring='"""Return the cached value, or None."""' |
| find_referencesA | List each occurrence of an identifier in a source file as Use this when: surveying a name's uses in a file before a rename. Don't use this when: you need references across files or by scope (use a language server). Example: target="LRUCache" |
| add_top_levelA | Add top-level code (a function, class, constant or other statement) to a source file. "bottom" appends it at the end, inside a header's include guard; "top" puts it after the preamble, before the first declaration. It is set apart by a blank line, two around a Python def or class, but one-line code added at the bottom under stacked one-line code is stacked too. In Go, or a file indented with tabs, its indentation becomes tabs. Use this when: adding a top-level symbol or statement. Don't use this when: placing it next to a symbol (insert_sibling), in a class (add_method, add_field), in a body (insert_in_body) or in a config file (add_key). Example: content="MAX_CONNECTIONS = 10" position="top" |
| read_symbolA | Return the source of one symbol (function, class, method, variable) or
the value of a config key, without reading the whole file. Read-only.
"full" is the text replace_function and delete_symbol take: decorators,
a JS/TS Use this when: reading one symbol; pick the narrowest depth. Don't use this when: you need the file's outline (list_symbols) or its imports (read_imports). Example: target="LRUCache", depth="interface" |
| read_importsA | Return the import statements of a source file (imports, includes, Ruby requires), without reading the rest. Read-only. Use this when: checking a file's dependencies, as before add_import. Don't use this when: changing imports (add_import, remove_import). Example: file_path="/abs/path/to/module.py" |
| edit_leading_commentA | Add, replace or remove the comment block directly above a symbol, its
doc comment. The block sits above the symbol's decorators, annotations,
Use this when: adding, rewriting or deleting a symbol's doc comment. Don't use this when: writing a Python docstring (replace_docstring) or a comment inside a body (insert_in_body, replace_in_body). Example: target="LRUCache.get", op="add", comment="# Return the cached value." |
| insert_siblingA | Insert code next to a named symbol, at its level. "before" goes above
the symbol's leading comment, decorators and Use this when: placing code relative to a symbol, such as a helper above its caller. Don't use this when: appending at the end of the file (add_top_level), or inserting into a body (insert_in_body) or a class (add_method, add_field). Example: target="LRUCache" content="CACHE_SIZE = 100" position="before" |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 28 tools
Most tools target distinct operations, and the descriptions provide explicit “Use this when / Don’t use this when” guidance to separate close neighbors like replace_function, replace_function_body, and replace_in_body. The remaining ambiguity comes from the large number of fine-grained edit tools, where an agent must carefully choose between body, signature, parameter, sibling, and top-level variants.
Names are consistently snake_case and verb-first, following predictable patterns such as add_import, remove_import_name, replace_signature, and list_symbols. The minor inconsistency is the mixed use of delete and remove for deletion operations, though the names remain readable and mostly predictable.
With 28 tools, the surface is heavy and requires agents to select among many highly granular operations. The domain is complex, but several tools could plausibly be consolidated or grouped under operation-based interfaces to reduce selection burden.
The server covers a strong lifecycle for imports, symbols, bodies, signatures, parameters, comments, docstrings, and config keys/arrays. Notable gaps remain around higher-level refactors such as rename-across-file or moving symbols, but agents can work around these by combining find_references and copy/delete operations.