Skip to main content
Glama
achatainga

mcp-code-context

by achatainga

insert_symbol

Insert code at a specific location using AST-based positioning. Uses two-phase process: dry-run returns diff and token, then confirm to apply.

Instructions

Insert code at a specific location. Phase 1: returns diff + token. Phase 2: confirm with token to apply.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to file
projectRootYesProject root (REQUIRED)
codeNoCode to insert (Phase 1 only ΓÇö omit in Phase 2, server uses stored content)
anchorSymbolNoSymbol to position relative to
positionNoWhere to insert
classNameNoClass name (optional)
confirmNoSet true to apply a pending operation (Phase 2)
confirmationTokenNoToken from Phase 1 dry-run (Phase 2 only)
diffFormatNoDiff verbosity in Phase 1 output (default: unified). Use none to skip diff and save tokens.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the two-phase process (dry-run then apply), diff generation, and token confirmation. However, it does not mention potential side effects, permissions, or error handling for token mismatches.

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?

Two sentences, front-loaded with purpose, and efficiently structured. Every word adds value.

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 two-phase complexity and 9 parameters without output schema, the description covers the workflow well. It could mention that Phase 1 does not apply changes and clarify return value structure, but it is largely complete.

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 description coverage is 100%, so baseline is 3. The description adds workflow context (Phase 1 vs Phase 2) but does not add meaning beyond the schema's parameter descriptions. The process explanation is helpful but not required for parameter understanding.

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 'Insert code at a specific location' and outlines a two-phase workflow, distinguishing it from sibling tools like remove_symbol or rename_symbol. The purpose is specific and actionable.

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?

The description implies usage for inserting code at a location but does not explicitly state when to use this tool versus alternatives like write_file_surgical or ast_transform. No when-not or exclusion criteria are provided.

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/achatainga/mcp-code-context'

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