Skip to main content
Glama

delete_symbol

Deletes a function or class definition, including its decorators and leading comment block, from a source file.

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
Behavior3/5

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

While the description explains the default behavior of removing leading comments and the include_leading_comments parameter, it lacks details on side effects, permissions, error handling, or reversibility. Without annotations, more transparency would be beneficial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: purpose first, then details, usage guidelines, and examples. Every sentence adds value with minimal verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema and moderate complexity, the description covers usage, parameter behavior, and alternatives. It could include error scenarios 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.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains the 'target' and 'include_leading_comments' parameters with examples and default behavior, adding meaning beyond the bare schema. The 'file_path' parameter is not explicitly described but its purpose is implied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool deletes an entire function or class definition along with its decorators. It differentiates from siblings by naming alternative tools like delete_key, remove_import, 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.

Usage Guidelines5/5

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 with specific alternatives, providing clear context for 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/agent-skills'

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