Skip to main content
Glama
markup-carve

carve-mcp

Official
by markup-carve

Apply structured AST patch

carve_apply_ast_patch
Read-only

Apply structured operations to a PART 12 Carve AST, validate them, and get the patched AST with canonical Carve source.

Instructions

Validate and apply structured operations to a PART 12 Carve AST, returning the patched AST and canonical Carve source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
astYesPART 12 base AST (maximum 1000000 JSON bytes)
operationsYesStructured patch operations (maximum 1000 operations and 1000000 JSON bytes)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
astYes
sourceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.3

TDQS

A4/5.0
Behavior4/5

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

Annotations already communicate read-only and non-destructive behavior, and the description adds useful context: the operation validates before applying, produces a patched AST, and emits canonical Carve source. This goes beyond the structured fields. readOnlyHint is consistent with an in-memory transformation, so there is no contradiction.

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 one tight, front-loaded sentence covering the action, input resource, and output. Every phrase contributes meaning, with no filler or redundant elaboration.

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, combined with the annotations and output schema, gives enough context to invoke the tool correctly. It explains validation, application, and result. The main gap is not explaining how operations are produced or when to use the reversible variant, but this is partially recoverable from sibling names.

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 100% because both ast and operations have descriptions. The description mostly restates those concepts ('structured operations', 'PART 12 Carve AST') without adding deeper meaning about operation shapes or expected AST structure, so the baseline of 3 is appropriate.

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 uses specific language: 'Validate and apply structured operations to a PART 12 Carve AST' and states the return value ('patched AST and canonical Carve source'). This clearly distinguishes it from sibling tools like carve_create_ast_patch, which creates patches, and carve_apply_reversible_ast_patch, which applies reversible patches.

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 the tool is used when you already have a PART 12 AST and structured operations to apply. However, it does not explicitly state when to choose this over the reversible or create-patch sibling tools, nor does it name alternatives or exclusion conditions.

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