Skip to main content
Glama

insert_after

Insert content as a sibling immediately after a named symbol like a function, class, or method in code files. Use for precise placement between existing elements without editing the entire file.

Instructions

Insert content as a sibling immediately after a named symbol (function, class, method, or top-level assignment).

Use this when: You need precise placement right after a symbol (e.g. a helper just after the function that uses it, or a new function between two existing ones). Don't use this when: You just want to append to the end of the file -> use add_top_level.

Example: target="LRUCache" content="RELATED_CONSTANT = 42"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the tool's behavior as inserting content after a symbol, which implies a mutation (likely write operation), but doesn't disclose permissions, error handling, or side effects. The example clarifies the target and content parameters, adding some context, but lacks details on file modification safety or response format.

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 well-structured and front-loaded with the core purpose, followed by usage guidelines and an example. Every sentence adds value without redundancy, making it efficient and easy to parse for an agent.

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 (mutation with 3 parameters), no annotations, and an output schema (which handles return values), the description is fairly complete. It covers purpose, usage, and parameter semantics but could improve by addressing behavioral aspects like permissions or error cases, though the output schema mitigates some gaps.

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 description coverage is 0%, so the description must compensate. It explains the 'target' parameter as a named symbol (e.g., 'LRUCache') and 'content' as the text to insert (e.g., 'RELATED_CONSTANT = 42'), adding meaning beyond the bare schema. However, it doesn't cover 'file_path' or provide format details, leaving some gaps.

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 action ('Insert content as a sibling') and the target ('immediately after a named symbol'), specifying the types of symbols (function, class, method, or top-level assignment). It distinguishes from sibling tools like 'add_top_level' by emphasizing precise placement after a specific symbol rather than appending to the file end.

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 usage guidelines with 'Use this when:' and 'Don't use this when:' sections, including a named alternative ('add_top_level'). It gives concrete examples of when to use (e.g., placing a helper after a function) and when not to use (appending to file end), helping the agent choose correctly among siblings.

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/agent-skills'

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