Skip to main content
Glama

insert_after_symbol

Insert text after a symbol's declaration to add methods or helpers. Provides a diff preview and works even without a language server by using tree-sitter parsing.

Instructions

Insert text immediately after a symbol's declaration.

Useful for adding a new method to a struct (insert after an existing one), or appending a related helper. Provide the full text to insert in 'content' — include leading newline if appropriate.

The response includes a unified diff of the change — a preview in dry-run, the applied change otherwise — unless show_write_diff is disabled.

Works even when the language server is cold or cannot parse the file: it then locates the symbol via a fresh tree-sitter parse (line-granular range, annotated in the output).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoAbsolute path, file:// URI, or workspace-relative path.
contentNoText to insert after the symbol.
dry_runNoIf true (default), preview only; do not write.
dirty_okNoAllow editing a file with uncommitted changes. Default false — review/commit first, or pass true to proceed.
name_pathYesSlash-separated symbol path within the file (e.g. "ClassName/methodName", or just "funcName" for top-level).
Behavior5/5

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

With no annotations, the description fully discloses behavior: it explains the diff response, preview vs. applied change, and the tree-sitter fallback for cold/unparseable files. This goes well beyond the basic write semantics implied by the tool name.

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?

Three tightly-written paragraphs; each sentence conveys a distinct, useful point (use case, content formatting, response behavior, fallback). No filler.

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?

Explains the response (unified diff) and edge-case behavior, but does not cover symbol-not-found errors or the dirty_ok workflow beyond the schema, and references an out-of-schema parameter.

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 covers all 5 parameters, so the baseline is 3; the description adds value by advising to include a leading newline in 'content' and mentioning a 'show_write_diff' option, though the latter is not in the schema (additionalProperties true).

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 the action ('Insert text immediately after a symbol's declaration'), specifies the resource (symbol), and differentiates from siblings like insert_before_symbol and replace_symbol_body by the positional scope.

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?

Provides explicit use cases ('adding a new method to a struct', 'appending a related helper') that indicate when to apply it. Does not mention alternatives or exclusions, but the positional 'after' and sibling tools imply the boundaries.

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/plumbkit/plumb'

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