Skip to main content
Glama
markup-carve

carve-mcp

Official
by markup-carve

Plan a semantic AST edit

carve_plan_ast_edit
Read-only

Plan atomic semantic AST edits to preview a reversible, stale-guarded source patch before writing the document.

Instructions

Plan one or more atomic semantic AST edits and return a human-readable, reversible, stale-guarded source patch without writing the document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editYes
thenNoAdditional atomic edits resolved against the original source (maximum 100 total steps).
sourceYesDocument source (maximum 1000000 UTF-8 bytes)
selectorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
editYes
matchYes
stepsYes
noticesYes
selectorYes
editCountYes
sourcePatchYes
reversiblePatchYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.5

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds meaningful context by specifying the patch is 'human-readable, reversible, stale-guarded', which goes beyond the annotations. It also reiterates the non-writing behavior, reinforcing consistency. No contradiction with annotations.

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 a single, efficient sentence that front-loads the primary action and key constraints. It wastes no words and conveys the essential purpose immediately. It is appropriately concise for a tool with this level of complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (nested objects, 4 parameters, multiple edit kinds, selector kinds), the description is far too sparse. It does not explain what 'atomic semantic AST edit' means, how selectors work, or what the patch format entails. Even though an output schema exists, the usage context for a tool this intricate is incomplete without parameter guidance.

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 only 50%, so the description should compensate by explaining parameters like selector, edit, and their nested structures. It does not—it is a single statement about the overall action. The schema provides enum values but no descriptions for most fields, and the description adds zero parameter-level meaning.

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 verb "Plan" and the resource "atomic semantic AST edits", and explicitly contrasts with siblings by saying "without writing the document". This distinguishes it from apply/create tools and clarifies its dry-run nature. The output is also specified as a reversible, stale-guarded patch, adding precise purpose.

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 a planning-only use case ('without writing the document') but does not explicitly mention when to use this tool versus alternatives like carve_apply_ast_patch or carve_create_ast_patch. There is no stated exclusion or explicit routing to sibling tools, leaving usage context implied rather than explicit.

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