Skip to main content
Glama
achatainga

mcp-code-context

by achatainga

ast_transform

Apply declarative code transformations — add parameters, wrap with try-catch, add decorators, change return types, or extract variables — with a two-phase write that previews changes before applying.

Instructions

Apply a declarative AST transformation to a symbol. Supports: add_parameter, wrap_with_try_catch, add_decorator, change_return_type, extract_variable. Uses two-phase write (Phase 1: preview diff, Phase 2: confirm with token).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to file
projectRootYesProject root (REQUIRED)
symbolNameYesTarget symbol to transform
classNameNoClass name (optional, for scoping)
transformYesTransform specification
confirmNoSet true to apply a pending operation (Phase 2)
confirmationTokenNoToken from Phase 1 dry-run (Phase 2 only)
diffFormatNoDiff verbosity (default: unified)
Behavior3/5

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

No annotations are provided, so the description bears full responsibility. It discloses the two-phase write behavior and the need for a confirmation token, which is important for a mutation tool. However, it does not mention permissions, potential side effects, or reversibility.

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 extremely concise (two sentences) with no extraneous information. The first sentence states purpose and capabilities, the second explains the two-phase process.

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?

The description explains the key two-phase process and lists supported transforms, which covers the essential behavioral aspects. However, it does not describe the output or return value (e.g., diff content, token structure), and no output schema exists.

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 the baseline is 3. The description adds the list of supported transform kinds and the two-phase workflow, but does not add new semantic detail beyond what the schema provides for individual parameters.

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 applies a declarative AST transformation to a symbol and lists specific supported transform kinds. It distinguishes itself from sibling tools like rename_symbol or remove_symbol by focusing on AST-level transformations.

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?

The description explicitly mentions the two-phase write pattern (Phase 1 preview, Phase 2 confirm), providing clear guidance on how to use the tool. However, it does not explicitly state when not to use this tool versus alternatives.

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