Carve
v0.1.13Parse, lint, format, render, and migrate Carve documents through MCP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
carve_lint Lint Carve
Check Carve source for author-facing problems and silent degradation.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
platforms | array |
carve_diagnose_and_fix Diagnose and fix Carve
Diagnose Carve source, propose bounded fixes, and optionally apply selected safe fix IDs with forward and undo patches. Writer-review fixes are never applied automatically.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
applyFixIds | array | |
platforms | array |
carve_format Format Carve
Format Carve source canonically and report any lossy raw-format nodes.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
alignTables | boolean | Pad table cells so columns align. |
carve_render Render Carve
Render Carve to HTML, Markdown, plain text, or ANSI terminal text, with loss reporting.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
target * | string | |
allowRawHtml | boolean | Pass trusted raw HTML through on HTML output. Disabled by default. |
asciiHeadingIds | string | Heading ID policy; explicit values override the preset. |
extensions | array | Opt-in extensions; semantic-spans is HTML-only. |
lowercaseHeadingIds | boolean | Lowercase generated heading IDs; explicit values override the preset. |
maxRenderLosses | integer | Maximum detailed losses to return. |
preset | string | portable lowercases IDs and transliterates where possible; static-html is HTML-only. |
sanitizeUrls | boolean | Report blocked authored URL schemes as render losses. A dangerous scheme is always blanked; this server never emits one. |
smartTypography | false is source; { quotes: false } keeps typed quotes only. | |
strictLosses | boolean | Fail instead of returning output when a raw-format node would be dropped. |
carve_check_targets Check Carve publishing targets
Compare one Carve document across HTML, Markdown, plain text, ANSI, GitHub, WordPress, and PDF-stage profiles, returning target-specific warnings, losses, and fallbacks.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
targets | array |
carve_parse Parse Carve
Parse and resolve Carve into its position-aware interchange AST.
| Parameter | Type | Description |
|---|---|---|
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
positions | boolean | Include source positions. |
carve_create_ast_patch Create structured AST patch
Compare two PART 12 Carve ASTs and return position-independent add, replace, and remove operations.
| Parameter | Type | Description |
|---|---|---|
after * | PART 12 AST after the edit (maximum 1000000 JSON bytes) | |
before * | PART 12 AST before the edit (maximum 1000000 JSON bytes) |
carve_apply_ast_patch Apply structured AST patch
Validate and apply structured operations to a PART 12 Carve AST, returning the patched AST and canonical Carve source.
| Parameter | Type | Description |
|---|---|---|
ast * | PART 12 base AST (maximum 1000000 JSON bytes) | |
operations * | array | Structured patch operations (maximum 1000 operations and 1000000 JSON bytes) |
carve_select_ast_nodes Find AST nodes by semantic selector
Resolve an element ID on any node, a heading ID, footnote label, node type, or current AST path to reviewable PART 12 AST paths without silently choosing among multiple matches.
| Parameter | Type | Description |
|---|---|---|
ast * | PART 12 AST (maximum 1000000 JSON bytes) | |
selector * | object |
carve_get_block Get Carve source blocks
Return the exact source text of the nodes a selector matches, or a heading's section, with UTF-8 byte offsets and the source sha256. No AST unless includeAst.
| Parameter | Type | Description |
|---|---|---|
selector * | object | |
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
includeAst | boolean | |
scope | string | section: a heading through its content, up to the next heading of the same or higher level. |
carve_replace_source Replace Carve source of one node
Splice Carve text over the exact source bytes of one selected node or heading section, leaving every other byte untouched. Refuses if the node kind changes, the rest of the document parses differently, or new lint findings appear. Returns forward and undo patches.
| Parameter | Type | Description |
|---|---|---|
selector * | object | |
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
text * | string | Carve source that replaces the selected range. |
expectedSha256 | string | Source sha256 from carve_get_block; a mismatch refuses the edit. |
includeSource | boolean | Also return the whole edited source. |
scope | string | section: a heading through its content, up to the next heading of the same or higher level. |
carve_plan_ast_edit Plan a semantic AST edit
Plan one or more atomic semantic AST edits and return a human-readable, reversible, stale-guarded source patch without writing the document.
| Parameter | Type | Description |
|---|---|---|
edit * | object | |
selector * | object | |
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
then | array | Additional atomic edits resolved against the original source (maximum 100 total steps). |
carve_create_reversible_ast_patch Create reversible AST patch
Compare two PART 12 ASTs and return forward and inverse operations with semantic stale-edit fingerprints.
| Parameter | Type | Description |
|---|---|---|
after * | PART 12 AST after the edit (maximum 1000000 JSON bytes) | |
before * | PART 12 AST before the edit (maximum 1000000 JSON bytes) |
carve_apply_reversible_ast_patch Preview reversible AST patch as source edits
Verify a reversible AST patch against source, apply or undo it, and return a minimal stale-guarded UTF-8 source edit without writing files.
| Parameter | Type | Description |
|---|---|---|
patch * | object | Version 1 reversible AST patch (maximum 1000000 JSON bytes and 1000 operations per direction) |
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
includeAst | boolean | Also return the patched AST. |
inverse | boolean | Apply inverse operations to undo the patch. |
carve_migrate Migrate to Carve
Migrate HTML, Markdown, Djot, or BBCode source to Carve with version 2 fidelity diagnostics.
| Parameter | Type | Description |
|---|---|---|
format * | string | |
source * | string | Document source (maximum 1000000 UTF-8 bytes) |
markdownDialect | object | Opt-in Markdown flavor constructs; valid only for Markdown input. |