Skip to main content
Glama

insert_code

Insert new code lines before or after an existing symbol while matching indentation; writes only after parse validation to prevent syntax breaks.

Instructions

Insert new_text on its own lines before or after an existing symbol (where='before'|'after'), matching its indentation. Parse-validated before writing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathNo
forceNo
whereNoafter
dry_runNo
new_textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

B3.3/5.0
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 disclosure burden. It usefully states that indentation is matched and that the edit is parse-validated before writing, which is real behavioral context beyond the schema. However, it says nothing about permission requirements, rollback, or what force and dry_run actually change at runtime.

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?

A single dense sentence plus a short validating clause. The anchor constraint is front-loaded and every word earns its place with no filler.

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?

An output schema exists, so return values need not be explained, and the core insert semantics are covered. But for a mutation tool with zero annotation coverage and two opaque control parameters (force, dry_run), the description leaves meaningful gaps an agent would need to guess at.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 6 parameters, so the description must compensate. It documents the where values ('before'|'after'), which is the only place that enum is expressed since the schema has no enums, but path, force, and dry_run are completely unexplained despite being safety-relevant.

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?

States a specific verb (Insert), resource (new_text on its own lines), and anchor (before/after an existing symbol). An agent can distinguish it from replace_symbol or rename_symbol by behavior, though the description never names those siblings 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?

Usage is implied by the anchor semantics (insert relative to a symbol), but there is no explicit when-to-use guidance, no mention of when to prefer replace_symbol/rename_symbol, and no indication of when force or dry_run should be used.

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