Skip to main content
Glama
civil-qto-mcp

civil-qto-mcp

extract_utility_network_and_levels

Extract manhole, gully, pipe segment, and level data from DXF drawings to compute DIN 4124/EN 1610 trench and bedding earthworks for utility quantity takeoffs.

Instructions

[STEP 3B of HITL Workflow] Extract utility manholes/gullies, levels, pipe segments, and DIN 4124 / EN 1610 trench earthworks.

Priority order for manhole data extraction:
1. `INSERT` block attributes (`insert.attribs` / `ATTRIB` tags for ID, Cover/Rim level, Invert level, DN)
2. Leader-aware spatial matching (`LEADER` / pointer line arrow tips pointing to manholes)
3. `STRtree` spatial proximity matching within `search_radius_m` (supporting HU, DE, and EN callout syntax)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>"
    },
    "name": "extract_utility_network_and_levels"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_pathYesPath to the .dxf drawing file.
node_layersNoLayers containing manholes, gullies, or chambers (INSERT blocks, CIRCLEs, small closed box polylines).
pipe_layersNoLayers containing utility pipe/conduit centerlines.
text_layersNoLayers containing callout texts (TEXT, MTEXT) and leader lines (LEADER, LINE). If None, scans all layers.
search_radius_mNoMaximum spatial proximity radius (m) to associate callout texts with manholes or pipes.
default_pipe_dn_mmNoDefault nominal pipe diameter DN (mm) when no text callout specifies DN.
bedding_thickness_mNoBedding layer thickness below pipe barrel in meters (default 0.10m per EN 1610).
unit_scale_to_meterNoConfirmed multiplier converting 1.0 CAD unit to meters (1.0 for m, 0.01 for cm, 0.001 for mm).
trench_wall_angle_degNoTrench wall angle in degrees per DIN 4124 (90.0 = vertical shored trench, 60.0 or 45.0 = sloped trench).
fallback_trench_depth_mNoOptional fallback invert depth (m) to use for trench earthworks when pipe endpoint manholes lack level annotations.
side_cover_above_crown_mNoPipe-zone protective cover above pipe crown in meters (default 0.30m per EN 1610).
calculate_trench_earthworksNoWhether to calculate DIN 4124 / MSZ EN 1610 trench earthwork and bedding volumes.
cover_thickness_deduction_mNoCast-iron cover/frame thickness (m) deducted from total depth h1 to get net shaft height h2 (default 0.17m for D400).

Output Schema

NameRequiredDescriptionDefault
nodesNo
anomaliesNo
file_pathYes
node_countYes
pipe_segmentsNo
earthwork_summaryNo
unit_scale_to_meterYes
diameter_distributionNo
total_network_length_mYes
length_by_dn_and_materialNo
nodes_with_complete_levelsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose a genuinely useful internal behavior: a three-tier resolution strategy for manhole data (INSERT block ATTRIBs, leader-aware spatial matching, then STRtree proximity within search_radius_m). It does not state whether files are written, what happens when level data is missing beyond one fallback parameter, or anything about runtime cost on large drawings.

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?

The definition is short and front-loaded: a one-line scope statement followed by a numbered resolution priority list. Every line carries information, and the workflow tag is placed before the substance. It could be tightened only slightly by folding the priority list into a single sentence.

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?

For a 13-parameter, algorithmically rich extraction tool with an output schema and no annotations, the description is thin — it never addresses unit-scaling caveats, what the trench earthworks output contains at a high level, or failure modes when no level callouts are found. The output schema covers return values, which reduces the burden, but the behavioral surface of this tool is larger than three sentences can cover.

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 description coverage is 100% across all 13 parameters, so the schema already documents meanings, units, defaults, and ranges. The description adds marginal value by naming `search_radius_m` in the matching-strategy context, but gives no additional guidance on how node/pipe/text layers interact or when to disable `calculate_trench_earthworks`. Baseline 3 applies when the schema does the heavy lifting.

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?

The description names a specific extraction target set — manholes/gullies, levels, pipe segments, and DIN 4124 / EN 1610 trench earthworks — with a clear verb ('Extract') and a workflow position tag (STEP 3B). It is understandable without opening the schema, though it doesn't explicitly differentiate itself from data-reading siblings such as inspect_civil_dxf or convert_dwg_to_dxf.

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 '[STEP 3B of HITL Workflow]' tag implies sequencing within a larger pipeline, which is useful context. However, there is no explicit statement of when to choose this tool over the DXF inspection or measurement siblings, and no prerequisites (e.g., must the file already be converted to .dxf?) are stated.

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