Skip to main content
Glama
markup-carve

carve-mcp

Official
by markup-carve

Find AST nodes by semantic selector

carve_select_ast_nodes
Read-only

Resolve element IDs, heading IDs, footnote labels, node types, or AST paths to reviewable PART 12 AST paths, returning all matches instead of silently choosing one.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
astYesPART 12 AST (maximum 1000000 JSON bytes)
selectorYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
matchesYes
selectorYes
truncatedYes
matchCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 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"
      +]
    • 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"
      +]
  2. Changed4 schema fields changedv0.1.5
    • changedInput schema / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type"
      -]New value: +[
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
    • changedInput schema / properties / selector / properties / value / maxLength
      Previous value: -256New value: +4096
    • changedOutput schema / properties / selector / properties / kind / enum
      Previous value: -[
      -  "heading-id",
      -  "footnote-label",
      -  "node-type"
      -]New value: +[
      +  "heading-id",
      +  "footnote-label",
      +  "node-type",
      +  "ast-path"
      +]
    • changedOutput schema / properties / selector / properties / value / maxLength
      Previous value: -256New value: +4096
  3. Addedv0.1.4

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 safety is covered. The description adds a genuine behavioral trait beyond that: it resolves 'without silently choosing among multiple matches,' telling the agent ambiguous selectors are surfaced rather than arbitrarily resolved. It does not discuss the returned path shape or limits.

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 that front-loads the resolution verb and the accepted selector types, with the ambiguity caveat as the closing clause. Nothing is wasted, though the phrasing is somewhat run-on and could be split for scanability.

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 values need no explanation, and the description covers the selector taxonomy plus the key ambiguity behavior. Remaining gaps (selector value formats, what happens on zero matches) are minor for a two-parameter read-only lookup.

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% – the 'ast' param is documented (with its 1,000,000-byte cap) but the nested selector object's kind/value are undocumented in the schema. The description compensates by spelling out the five selector kinds in prose, matching the enum, but adds no syntax or format detail for values or the ast-path form. Baseline 3 is appropriate.

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 (Resolve) and resource (reviewable PART 12 AST paths) and enumerates the five accepted selector kinds, so an agent knows exactly what this tool consumes and produces. It does not explicitly name a sibling it differs from, but the resolution role is clear enough to separate it from parse/format/render.

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: by listing selector kinds the description hints that this is the resolution step before an edit, but it never states when to prefer it over siblings like carve_check_targets or carve_get_block, nor any prerequisites. No exclusions or alternative routing is given.

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