Skip to main content
Glama
markup-carve

carve-mcp

Official
by markup-carve

Get Carve source blocks

carve_get_block
Read-only

Extract exact source text for nodes matching a selector or a heading's full section, returning UTF-8 byte offsets and a source sha256 for verification.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNosection: a heading through its content, up to the next heading of the same or higher level.node
sourceYesDocument source (maximum 1000000 UTF-8 bytes)
selectorYes
includeAstNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
blocksYes
sha256Yes
truncatedYes
matchCountYes
sourceBytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.6

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already establish this is a safe, read-only, closed-world operation, and the description usefully adds that it returns byte offsets and a source sha256 and that AST is opt-in via includeAst. It says nothing about failure modes for non-matching selectors or the 1MB source limit beyond what the schema states.

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?

Two sentences, tightly front-loaded with the return payload first and the AST caveat last; nothing is padded. Slightly clipped phrasing ('No AST unless includeAst') trades a little clarity for brevity.

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

Completeness3/5

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

With an output schema present, return-value detail is largely covered elsewhere, and annotations cover the safety profile. The remaining holes are the meaning of the selector kinds and behavior on no-match, which an agent needs to invoke the tool reliably.

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%: 'scope' and 'source' are documented in the schema, and the description reinforces both. However, the five selector kinds (id, heading-id, footnote-label, node-type, ast-path) and includeAst have no descriptions anywhere, so the description leaves a key disambiguation gap unfilled.

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?

States a specific verb and resource ('return the exact source text of the nodes a selector matches') plus the two scoping modes (node vs heading section). The clause 'No AST unless includeAst' cleanly distinguishes it from AST-returning siblings like carve_parse and carve_select_ast_nodes.

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?

Usage is only implied: an agent can infer it should call this when raw source text plus offsets/checksum is wanted, and the 'No AST' clause hints that AST retrieval belongs to another tool. But no alternative is named and there is no explicit when-to-use or when-not-to-use guidance.

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