Skip to main content
Glama

insert_symbol

Add a new function, method, or class next to an existing symbol, anchored by name so batch edits survive line changes and new code matches neighbours.

Instructions

Add a new function, method or class next to an existing one. Classes are addressable, so a class is a valid anchor and a valid thing to insert. Anchoring to a symbol rather than a line number is what makes this usable in a batch: the anchor does not move when everything above it changes. The anchor is also shown to the worker as a style reference, so the new code matches its neighbours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
anchorYesExisting symbol to position against. 'Class::method' when ambiguous.
contextNo
positionYesAnchored to a class, 'end_of_class' appends a member to that class — the direct way to add a method to it. Anchored to a member, it appends to the class the member belongs to.
file_pathYes
instructionYesWhat the new symbol should be. Say 'output only the symbol' to avoid getting a whole class back.
allow_secretsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that the anchor is shown to the worker as a style reference and that symbols are stable under edits above them, but it omits mutation side effects, reversibility (relevant given revert_patch/revert_session siblings), and any handling guidance for allow_secrets.

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?

Four sentences, front-loaded with the core action, and each subsequent sentence adds a distinct rationale (batch stability, style matching). Slight redundancy in "a class is a valid anchor and a valid thing to insert," but overall efficient.

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

Completeness3/5

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

For a 6-parameter mutation tool with no annotations and no output schema, the description covers purpose and the anchor rationale well but is silent on failure behavior, whether existing code is ever touched, and the undocumented context/allow_secrets parameters. Adequate, with visible gaps.

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 coverage is 50%, and the description reinforces the anchor concept (classes addressable, 'Class::method') already stated in the schema. It adds nothing for the two undocumented parameters, context and allow_secrets, leaving their semantics unstated anywhere.

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

Purpose4/5

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

The opening sentence gives a specific verb and resource: "Add a new function, method or class next to an existing one." That is enough to distinguish it from fix_symbols/fix_symbol (repair) and create_file (whole-file creation) without opening schemas, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

It states the conceptual advantage of symbol anchoring over line numbers and frames the tool as batch-friendly, which implies when to reach for it. However, it never says when NOT to use it or points to siblings like create_file or fix_symbol as alternatives, so routing is left largely to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.