Skip to main content
Glama

insert_sibling

Insert content before or after a named symbol (function, class, method, or top-level assignment) for precise placement relative to another symbol.

Instructions

Insert content as a sibling of a named symbol (function, class, method, or top-level assignment). Pass position="before" or position="after".

Use this when: You need precise placement relative to another top-level symbol -- e.g. a helper function immediately before its caller, a constant immediately above the class that uses it. Don't use this when: You just want to append to the end of the file -> use add_top_level. You're inserting inside a function body -> use insert_in_body (with at, after, or before).

Example: target="LRUCache" content="CACHE_SIZE = 100" position="before"

target="LRUCache"
content="RELATED_CONSTANT = 42"
position="after"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
contentYes
positionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral traits. It explains basic operation (inserting a sibling at a specified position) and the types of symbols covered. However, it lacks details on side effects (e.g., ordering of multiple siblings), error handling (e.g., target not found), or reversibility, which is insufficient for a tool without annotation support.

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 concise with two succinct paragraphs plus an example. Every sentence adds value: first sentence states purpose, second provides usage guidelines and alternatives, and the example demonstrates typical usage. No redundant or unnecessary content.

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 complexity of the tool (4 required parameters, many sibling tools), the description covers essential aspects: purpose, usage criteria, alternatives, and an example. It does not describe the output schema, but that is not required. The only minor gap is lack of parameter semantics for all parameters, but overall it provides sufficient context for an agent to use the tool correctly.

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?

The input schema has 0% parameter description coverage. The description adds meaning for the 'position' parameter (before/after) and 'target' (named symbol). It also clarifies 'content' via examples. However, 'file_path' and the exact format of 'target' and 'content' are not explicitly defined. While it improves upon the bare schema, it does not fully compensate for the lack of parameter descriptions.

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 tool inserts content as a sibling of a named symbol, specifying position options 'before' or 'after'. It differentiates from sibling tools by naming alternatives like add_top_level and insert_in_body, 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 Guidelines5/5

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

The description explicitly provides when-to-use scenarios (precise placement relative to a top-level symbol) and when-not-to-use scenarios (appending to end of file -> use add_top_level; inserting inside function body -> use insert_in_body). It names specific alternative tools, offering clear guidance.

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