Skip to main content
Glama

delete_in_body

Delete a specific line or block of code inside a function or method body without rewriting the entire function. Useful for removing a single entry from an inline object literal passed as an argument.

Instructions

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"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
snippetYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

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