Skip to main content
Glama

Insert After Symbol

insert_after_symbol
Destructive

Insert new code after specific symbol definitions in files to add classes, functions, methods, or assignments without manual file editing.

Instructions

Inserts the given body/content after the end of the definition of the given symbol (via the symbol's location). A typical use case is to insert a new class, function, method, field or variable assignment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
name_pathYesName path of the symbol after which to insert content (definitions in the `find_symbol` tool apply).
relative_pathYesThe relative path to the file containing the symbol.
bodyYesThe body/content to be inserted. The inserted code shall begin with the next line after the symbol.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

Annotations indicate 'destructiveHint: true' and 'readOnlyHint: false', which the description aligns with by describing an insertion operation. The description adds useful context about the insertion location ('after the end of the definition') and references 'find_symbol' for symbol definitions, but it does not disclose additional behavioral traits like error handling, formatting requirements, or side effects beyond what annotations provide.

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 front-loaded with the core action in the first sentence and uses a second sentence for a typical use case, with no wasted words. Every sentence adds value by clarifying purpose and context, making it efficiently structured and easy to parse.

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's complexity (destructive insertion with three parameters), annotations cover safety aspects, and an output schema exists (though not provided here), the description is reasonably complete. It explains the insertion logic and references related tools, but could benefit from more details on error cases or output format, though the output schema mitigates this gap.

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 description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by implying the relationship between 'name_path' and 'find_symbol' and noting that insertion occurs on the next line, but it does not provide significant additional semantic details. This meets the baseline for high schema coverage.

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 the specific action ('Inserts') and target ('after the end of the definition of the given symbol'), distinguishing it from sibling tools like 'insert_before_symbol' and 'replace_symbol_body'. It provides concrete examples of typical use cases (inserting classes, functions, methods, etc.), 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.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool by mentioning 'after the end of the definition' and referencing the 'find_symbol' tool for symbol definitions, but it does not explicitly state when not to use it or name alternatives. It provides clear context for insertion scenarios without detailing exclusions or comparisons to siblings like 'insert_before_symbol'.

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/chrisgreenx-ctrl/serena'

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