Skip to main content
Glama

delete_symbol

Delete an entire function, method, or class definition including its decorators and leading doc comment. Use to remove structural code elements from source files.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
include_leading_commentsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kambleakash0/ast-editor'

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