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 and return a human-readable, reversible, stale-guarded source patch without 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
sha256No
noticesYes
selectorYes
editCountYes
sourcePatchYes
reversiblePatchYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.6
    • changedInput schema / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type",
      -  "ast-path"
      -]New value: +[
      +  "id",
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
    • changedInput schema / properties / then / items / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type",
      -  "ast-path"
      -]New value: +[
      +  "id",
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
    • changedOutput schema / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type",
      -  "ast-path"
      -]New value: +[
      +  "id",
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
    • addedOutput schema / properties / sha256
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / steps / items / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type",
      -  "ast-path"
      -]New value: +[
      +  "id",
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
  2. 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, so 'without writing the document' is largely redundant. The description still earns credit by disclosing traits annotations cannot express: the plan is 'reversible', 'stale-guarded', and 'human-readable', which tells the agent how the output behaves on concurrent modification.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence with no filler, and the key outcome (return a patch without writing) is front-loaded. It is appropriately sized for the tool, though the adjective stack ('human-readable, reversible, stale-guarded') slightly crowds the core claim.

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?

An output schema exists, so return-value explanation is unnecessary and correctly absent. The description covers the non-mutating, reversible, stale-guarded character of the operation, which is sufficient for a 4-parameter planning tool; only the sequencing behavior of the optional 'then' array is unaddressed.

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 coverage is 50% and the schema itself carries the selector and edit 'kind' enums, so most semantics come from structured data. The description contributes only the notion of 'one or more atomic' edits, hinting at the top-level 'edit' plus the 'then' array, but says nothing about selector resolution or edit kinds.

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 ('Plan'), a resource ('atomic semantic AST edits'), and the artifact produced ('a human-readable, reversible, stale-guarded source patch'). It implicitly distinguishes itself from the apply/patch siblings by saying 'without writing the document', though it does not name the alternatives.

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 phrase 'without writing the document' implies this is the non-mutating planning step, which an agent can infer precedes the apply siblings. However there is no explicit when-to-use statement and no routing against carve_create_ast_patch, carve_create_reversible_ast_patch, or carve_apply_reversible_ast_patch.

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