com.civilquants/civilquants is an MCP server published by com.civilquants, hosted at api.civilquants.com. When last checked on 2026-11-24 it was working: it answers and lists its tools. It declares 26 tools, including compute_connection_to_existing, compute_hard_material_in_trench, compute_ditch, compute_pipework_testing, compute_catchpit.
Parametric estimating engine: CESMM4/NRM2/SMM7/MMHW Bills of Quantities for civils assemblies.
2 connections through 4 shared values. Tap any node.
Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Enumerated extra-over connection of a new drainage carrier pipe into an existing asset: existing manhole / inspection chamber, existing sewer or drain (via saddle / wye / cut-in junction), or existing outfall / watercourse / surface system. Routes via CESMM4 I.7.1/2/3 (Class I §I.7 Pipework Ancillaries — Connections), NRM2 33.6.1/2/3, MMHW 500.5.1/2/3 (SHW Cl. 506 Connections to existing sewers, drains and service runs), SMM7 R12.4.1/2/3, with a bore-size digit suffix appended in all four. The connection_type attribute is the discriminator that routes to the right sub-code; the bore digit refines within. Six variant presets cover all three connection types × two characteristic bores. Unit: Nr. Opens the new `drainage_ancillaries` L2 leaf (reserved for ditch, hard-material extra-over, CCTV testing, etc. in future sessions). Sibling assembly: carrier_pipe_run — the S32 pair that delivers a complete tender drainage line. Example params: diameter_mm=225 mm (100–2400). Example call: {"params": {"diameter_mm": 225}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
None yet. Changes appear after a server's second daily check.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a single connection-to-existing extra-over item. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_connection_to_existing",
"title": "Compute Connection to Existing (drainage) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Enumerated extra-over connection of a new drainage carrier pipe into an existing asset: existing manhole / inspection chamber, existing sewer or drain (via saddle / wye / cut-in junction), or existing outfall / watercourse / surface system. Routes via CESMM4 I.7.1/2/3 (Class I §I.7 Pipework Ancillaries — Connections), NRM2 33.6.1/2/3, MMHW 500.5.1/2/3 (SHW Cl. 506 Connections to existing sewers, drains and service runs), SMM7 R12.4.1/2/3, with a bore-size digit suffix appended in all four. The connection_type attribute is the discriminator that routes to the right sub-code; the bore digit refines within. Six variant presets cover all three connection types × two characteristic bores. Unit: Nr. Opens the new `drainage_ancillaries` L2 leaf (reserved for ditch, hard-material extra-over, CCTV testing, etc. in future sessions). Sibling assembly: carrier_pipe_run — the S32 pair that delivers a complete tender drainage line. Example params: diameter_mm=225 mm (100–2400). Example call: {\"params\": {\"diameter_mm\": 225}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"method": {
"enum": [
"saddle connection",
"wye junction fitting",
"cut-in junction",
"core-drilled breakthrough",
"level outfall"
],
"type": "string",
"default": "core-drilled breakthrough",
"description": "How the physical connection is made — informs the description\nbut does not change the BoQ code (the code is governed by the\nconnection_type discriminator + bore digit)."
},
"diameter_mm": {
"type": "integer",
"default": 225
},
"connection_type": {
"enum": [
"existing_manhole",
"existing_pipeline",
"existing_outfall"
],
"type": "string",
"default": "existing_manhole",
"description": "The type of existing asset the new pipe run connects to.\n\nThe discriminator that routes through to the four standards'\nsub-codes:\n existing_manhole → CESMM4 I.7.1 / NRM2 33.6.1 / MMHW 500.5.1\n / SMM7 R12.4.1\n existing_pipeline → CESMM4 I.7.2 / NRM2 33.6.2 / MMHW 500.5.2\n / SMM7 R12.4.2\n existing_outfall → CESMM4 I.7.3 / NRM2 33.6.3 / MMHW 500.5.3\n / SMM7 R12.4.3"
},
"existing_asset_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Parameters for a single connection-to-existing extra-over item."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear extra-over measurement of hard material encountered during drainage trench excavation. Discriminates between natural rock (CESMM4 E.6 / NRM2 5.6.1 / MMHW 500.6.1 / SMM7 R12.6.1) and artificial hard material — buried concrete / masonry / obstructions (CESMM4 E.7 / NRM2 5.6.2 / MMHW 500.6.2 / SMM7 R12.6.2). The platform's first dual-quantity WorkItem: carries both length_m and volume_m3 so CESMM4/NRM2 (m³) and MMHW/SMM7 (m) each render with their correct unit per the standards' rules. Eight variant presets cover both hard-material types × four depth bands. SMM7 R12 deems trench excavation (including hard material) included in the pipe-run rate — the SMM7 handler emits a zero-priceable annotated line for tender transparency (third use of the deemed-included extra-over annotation pattern). Closes the drainage_ancillaries L2 leaf at 4/4 members. Sibling assemblies: connection_to_existing (S32), ditch (S33), pipework_testing (S33). Example params: length_m=10 m (0.5–500), max_depth_m=1.5 m (0.3–10), trench_width_m=0.7 m (0.3–3). Example call: {"params": {"length_m": 10, "max_depth_m": 1.5, "trench_width_m": 0.7}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a single hard-material extra-over scenario. Geometry interpretation: - `length_m` is the chainage extent of the hard-material zone (i.e. how many metres of pipe-run encounter hard material). This is the MMHW/SMM7 quantity directly. - `trench_width_m` is the trench plan wi… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_hard_material_in_trench",
"title": "Compute Hard Material in Trench (extra-over) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear extra-over measurement of hard material encountered during drainage trench excavation. Discriminates between natural rock (CESMM4 E.6 / NRM2 5.6.1 / MMHW 500.6.1 / SMM7 R12.6.1) and artificial hard material — buried concrete / masonry / obstructions (CESMM4 E.7 / NRM2 5.6.2 / MMHW 500.6.2 / SMM7 R12.6.2). The platform's first dual-quantity WorkItem: carries both length_m and volume_m3 so CESMM4/NRM2 (m³) and MMHW/SMM7 (m) each render with their correct unit per the standards' rules. Eight variant presets cover both hard-material types × four depth bands. SMM7 R12 deems trench excavation (including hard material) included in the pipe-run rate — the SMM7 handler emits a zero-priceable annotated line for tender transparency (third use of the deemed-included extra-over annotation pattern). Closes the drainage_ancillaries L2 leaf at 4/4 members. Sibling assemblies: connection_to_existing (S32), ditch (S33), pipework_testing (S33). Example params: length_m=10 m (0.5–500), max_depth_m=1.5 m (0.3–10), trench_width_m=0.7 m (0.3–3). Example call: {\"params\": {\"length_m\": 10, \"max_depth_m\": 1.5, \"trench_width_m\": 0.7}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"length_m": {
"type": "number",
"default": 10
},
"max_depth_m": {
"type": "number",
"default": 1.5
},
"trench_width_m": {
"type": "number",
"default": 0.7
},
"pipe_diameter_mm": {
"type": "integer",
"default": 225
},
"existing_asset_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"hard_material_type": {
"enum": [
"natural_rock",
"artificial_hard_material"
],
"type": "string",
"default": "natural_rock",
"description": "The type of hard material encountered.\n\nThe discriminator that routes through the four standards' hard-\nmaterial codes:\n natural_rock -> CESMM4 E.6, NRM2 5.6.1, MMHW 500.6.1, SMM7 R12.6.1\n artificial -> CESMM4 E.7, NRM2 5.6.2, MMHW 500.6.2, SMM7 R12.6.2\n\nNatural rock = igneous/metamorphic/strongly cemented sedimentary\nrequiring blasting or heavy mechanical breaking; the UK industry\nthreshold is broadly \"material with a UCS > 20 MPa or visibly\nintact rock requiring more than ripper-mounted tracked plant\".\n\nArtificial hard material = man-made obstructions encountered\nduring excavation — mass concrete, reinforced concrete bases,\nmasonry walls, buried foundations, kerbs and gully bases below\nfinished surface, redundant utility chambers.\n\nThese are the two materially-different operations that the four\nUK standards uniformly distinguish."
},
"height_of_hard_material_m": {
"type": "number",
"default": 0.5
}
},
"description": "Parameters for a single hard-material extra-over scenario.\n\nGeometry interpretation:\n - `length_m` is the chainage extent of the hard-material zone\n (i.e. how many metres of pipe-run encounter hard material).\n This is the MMHW/SMM7 quantity directly.\n - `trench_width_m` is the trench plan width at the level of the\n hard material — used (with height_of_hard_material_m and\n length_m) to compute the volumetric quantity used by\n CESMM4/NRM2.\n - `height_of_hard_material_m` is the vertical extent of hard\n material within the trench section — the bottom of the\n trench wraps the pipe envelope, so the hard-material height\n is typically less than the full trench depth. This is the\n QS's judgment, informed by site investigation.\n - `max_depth_m` is the depth (from finished ground level) to\n the bottom of the hard-material zone — drives the depth\n banding in all four handlers.\n - `pipe_diameter_mm` is descriptive only — propagated to the\n WorkItem for cross-referencing the carrier pipe.\n\nVolume = length_m × trench_width_m × height_of_hard_material_m."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear primary measurement of an open earthwork drainage channel — trapezoidal cross-section, four lining variants (unlined / geotextile / granular / concrete). Routes via CESMM4 Class E.4 (excavation for cuttings), NRM2 Group 34.10 (site works: open drains and ditches), MMHW Series 500.4 (SHW Cl. 514 Earthwork ditches and drains), SMM7 R13.4 (Land Drainage — ditches). Eight variant presets cover all four lining types x two characteristic size scenarios each. Unit: M. Second member of the drainage_ancillaries L2 leaf (opened at S32 with connection_to_existing). 20th use of the classed-then-legacy attribute discrimination pattern via the lining_type discriminator. The four standards genuinely diverge on which work-section heading owns ditches (Class E vs Group 34 vs Series 500 vs R13) — the platform renders all four honestly from one source WorkItem. Example params: run_length_m=100 m (1–1000), top_width_mm=1700 mm (200–10000), bottom_width_mm=500 mm (100–5000). Example call: {"params": {"run_length_m": 100, "top_width_mm": 1700, "bottom_width_mm": 500}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a single open-ditch primary measurement. The geometry is a trapezoidal cross-section run linearly along the ditch alignment. side_slope_h_per_v is the side slope expressed as horizontal-per-vertical (1.0 = 45 deg, 1.5 = ~34 deg, 0.5 = ~63 deg). |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_ditch",
"title": "Compute Open Ditch (drainage channel) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear primary measurement of an open earthwork drainage channel — trapezoidal cross-section, four lining variants (unlined / geotextile / granular / concrete). Routes via CESMM4 Class E.4 (excavation for cuttings), NRM2 Group 34.10 (site works: open drains and ditches), MMHW Series 500.4 (SHW Cl. 514 Earthwork ditches and drains), SMM7 R13.4 (Land Drainage — ditches). Eight variant presets cover all four lining types x two characteristic size scenarios each. Unit: M. Second member of the drainage_ancillaries L2 leaf (opened at S32 with connection_to_existing). 20th use of the classed-then-legacy attribute discrimination pattern via the lining_type discriminator. The four standards genuinely diverge on which work-section heading owns ditches (Class E vs Group 34 vs Series 500 vs R13) — the platform renders all four honestly from one source WorkItem. Example params: run_length_m=100 m (1–1000), top_width_mm=1700 mm (200–10000), bottom_width_mm=500 mm (100–5000). Example call: {\"params\": {\"run_length_m\": 100, \"top_width_mm\": 1700, \"bottom_width_mm\": 500}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"depth_mm": {
"type": "integer",
"default": 600
},
"lining_type": {
"enum": [
"unlined",
"geotextile",
"granular",
"concrete"
],
"type": "string",
"default": "unlined",
"description": "The lining material of the ditch (or unlined).\n\nThe discriminator that routes through to the four standards'\nsub-codes:\n unlined -> CESMM4 E.4.x.1 / NRM2 34.10.1 / MMHW 500.4.1\n / SMM7 R13.4.1\n geotextile -> CESMM4 E.4.x.2 / NRM2 34.10.2 / MMHW 500.4.2\n / SMM7 R13.4.2\n granular -> CESMM4 E.4.x.3 / NRM2 34.10.3 / MMHW 500.4.3\n / SMM7 R13.4.3\n concrete -> CESMM4 E.4.x.4 / NRM2 34.10.4 / MMHW 500.4.4\n / SMM7 R13.4.4"
},
"run_length_m": {
"type": "number",
"default": 100
},
"top_width_mm": {
"type": "integer",
"default": 1700
},
"bottom_width_mm": {
"type": "integer",
"default": 500
},
"side_slope_h_per_v": {
"type": "number",
"default": 1
},
"lining_thickness_mm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Parameters for a single open-ditch primary measurement.\n\nThe geometry is a trapezoidal cross-section run linearly along the\nditch alignment. side_slope_h_per_v is the side slope expressed as\nhorizontal-per-vertical (1.0 = 45 deg, 1.5 = ~34 deg, 0.5 = ~63 deg)."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear measurement of testing on new drainage pipework — CCTV survey, air pressure test, water pressure test, or mandrel pull-through. Routes via CESMM4 Class I §I.8 (Tests on new pipework), NRM2 Group 33.18 (Testing of drainage) as priceable lines; via MMHW Series 500.7 (per SHW Cl. 507 deemed included in pipe-run rate) and SMM7 R12.7 (R12 coverage rules deemed included) as zero-priceable annotated lines for tender transparency. Introduces the platform's third named maturity pattern: deemed-included extra-over annotation (joining classed-then-legacy and declared-then-banded). Eight variant presets cover all four test methods x two bore scenarios each. Unit: M. Third member of the drainage_ancillaries L2 leaf. 21st use of the discriminator pattern via test_method. Example params: length_tested_m=100 m (1–2000), diameter_mm=225 mm (100–2400). Example call: {"params": {"length_tested_m": 100, "diameter_mm": 225}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a single pipework testing measurement. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_pipework_testing",
"title": "Compute Pipework Testing (drainage) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear measurement of testing on new drainage pipework — CCTV survey, air pressure test, water pressure test, or mandrel pull-through. Routes via CESMM4 Class I §I.8 (Tests on new pipework), NRM2 Group 33.18 (Testing of drainage) as priceable lines; via MMHW Series 500.7 (per SHW Cl. 507 deemed included in pipe-run rate) and SMM7 R12.7 (R12 coverage rules deemed included) as zero-priceable annotated lines for tender transparency. Introduces the platform's third named maturity pattern: deemed-included extra-over annotation (joining classed-then-legacy and declared-then-banded). Eight variant presets cover all four test methods x two bore scenarios each. Unit: M. Third member of the drainage_ancillaries L2 leaf. 21st use of the discriminator pattern via test_method. Example params: length_tested_m=100 m (1–2000), diameter_mm=225 mm (100–2400). Example call: {\"params\": {\"length_tested_m\": 100, \"diameter_mm\": 225}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"diameter_mm": {
"type": "integer",
"default": 225
},
"test_method": {
"enum": [
"cctv",
"air_pressure",
"water_pressure",
"mandrel_pull"
],
"type": "string",
"default": "cctv",
"description": "Method of testing applied to the installed pipework.\n\nThe discriminator that routes through to the four standards'\nsub-codes:\n cctv -> CESMM4 I.8.1 / NRM2 33.18.1\n / MMHW 500.7.1 / SMM7 R12.7.1\n air_pressure -> CESMM4 I.8.2 / NRM2 33.18.2\n / MMHW 500.7.2 / SMM7 R12.7.2\n water_pressure -> CESMM4 I.8.3 / NRM2 33.18.3\n / MMHW 500.7.3 / SMM7 R12.7.3\n mandrel_pull -> CESMM4 I.8.4 / NRM2 33.18.4\n / MMHW 500.7.4 / SMM7 R12.7.4"
},
"pipe_material": {
"type": "string",
"default": "vitrified clay"
},
"length_tested_m": {
"type": "number",
"default": 100
}
},
"description": "Parameters for a single pipework testing measurement."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Precast concrete catchpit / silt trap to BS 5911-3 comprising factory-cast monolithic base with integral silt sump (600-900mm below outlet invert), stacked precast chamber rings, precast cover slab, ductile-iron frame and cover (BS EN 124 loading classes), optional step irons, granular or concrete bedding, granular surround, geotextile separator, and excavation. Catalogue-driven sizing from CP_900 (900mm ID) to CP_1800 (1800mm ID). Routes via chamber_type='catchpit' attribute discrimination through CESMM4 K.1.6.x, NRM2 33.7.14, MMHW 500.5.16 (SHW Cl. 511 silt traps), and SMM7 R12.3.13. Distinct from manholes by the silt-sump-below-channel geometry; typical position upstream of petrol/oil interceptor (S24) in a forecourt or service-area drainage train. Example params: invert_depth=2.5 m (0.5–10), bedding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.15 m (0.1–0.3). Example call: {"params": {"invert_depth": 2.5, "bedding_thickness_mm": 150, "bedding_overhang_m": 0.15}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a precast concrete catchpit / silt trap. Catalogue-driven: pick a ``size`` and the chamber's nominal dimensions, masses, and silt-sump depth are read from ``_CATALOGUE``. Override individual fields if a specific manufacturer differs. The catchpit is treated as a **manhole-family… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_catchpit",
"title": "Compute Precast Concrete Catchpit / Silt Trap BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Precast concrete catchpit / silt trap to BS 5911-3 comprising factory-cast monolithic base with integral silt sump (600-900mm below outlet invert), stacked precast chamber rings, precast cover slab, ductile-iron frame and cover (BS EN 124 loading classes), optional step irons, granular or concrete bedding, granular surround, geotextile separator, and excavation. Catalogue-driven sizing from CP_900 (900mm ID) to CP_1800 (1800mm ID). Routes via chamber_type='catchpit' attribute discrimination through CESMM4 K.1.6.x, NRM2 33.7.14, MMHW 500.5.16 (SHW Cl. 511 silt traps), and SMM7 R12.3.13. Distinct from manholes by the silt-sump-below-channel geometry; typical position upstream of petrol/oil interceptor (S24) in a forecourt or service-area drainage train. Example params: invert_depth=2.5 m (0.5–10), bedding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.15 m (0.1–0.3). Example call: {\"params\": {\"invert_depth\": 2.5, \"bedding_thickness_mm\": 150, \"bedding_overhang_m\": 0.15}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"CP_900",
"CP_1050",
"CP_1200",
"CP_1350",
"CP_1500",
"CP_1800"
],
"type": "string",
"default": "CP_1200",
"description": "Standard UK precast catchpit chamber internal diameters per\nBS 5911-3. Catalogued by CPM, FP McCann, Stanton Bonna, and\nCPM Group. CP_900 is the smallest commonly stocked precast\ncatchpit; CP_1800 is the largest practical without bespoke\norder (used for industrial heavy-silt loading or where the\ncatchpit also serves as a silt-removal pre-treatment chamber\nupstream of a Class 1 petrol interceptor)."
},
"quantity": {
"type": "integer",
"default": 1
},
"access_type": {
"enum": [
"step_irons",
"ladder",
"none"
],
"type": "string",
"default": "step_irons"
},
"project_ref": {
"type": "string",
"default": ""
},
"ring_mass_t": {
"type": "number",
"default": null
},
"bedding_type": {
"enum": [
"granular",
"concrete"
],
"type": "string",
"default": "granular",
"description": "Bedding layer beneath a precast catchpit base."
},
"invert_depth": {
"type": "number",
"default": 2.5
},
"cover_loading": {
"enum": [
"A15",
"B125",
"C250",
"D400",
"E600",
"F900"
],
"type": "string",
"default": "D400",
"description": "BS EN 124 cover-and-frame loading classes."
},
"ring_height_m": {
"type": "number",
"default": null
},
"chainage_label": {
"type": "string",
"default": ""
},
"wall_thickness": {
"type": "number",
"default": null
},
"base_unit_mass_t": {
"type": "number",
"default": null
},
"cover_slab_grade": {
"type": "string",
"default": "C40/50"
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"internal_diameter": {
"type": "number",
"default": null
},
"silt_sump_depth_m": {
"type": "number",
"default": null
},
"step_iron_spacing": {
"type": "number",
"default": 0.3
},
"surround_material": {
"type": "string",
"default": "20mm single-size aggregate"
},
"base_unit_height_m": {
"type": "number",
"default": null
},
"bedding_overhang_m": {
"type": "number",
"default": 0.15
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter"
},
"surround_thickness": {
"type": "number",
"default": 0.15
},
"cover_clear_opening": {
"type": "number",
"default": 0.6
},
"bedding_thickness_mm": {
"type": "integer",
"default": 150
},
"cover_slab_thickness": {
"type": "number",
"default": 0.2
},
"cover_to_top_of_slab": {
"type": "number",
"default": 0.075
},
"geotextile_full_wrap": {
"type": "boolean",
"default": true
},
"seating_rings_height": {
"type": "number",
"default": 0.15
},
"bedding_concrete_grade": {
"type": "string",
"default": "C8/10"
},
"bedding_granular_class": {
"type": "string",
"default": "6N"
},
"working_space_each_side": {
"type": "number",
"default": 0.5
},
"is_pretreatment_for_interceptor": {
"type": "boolean",
"default": false
},
"sheet_pile_depth_below_formation": {
"type": "number",
"default": 1
}
},
"description": "Parameter form for a precast concrete catchpit / silt trap.\n\nCatalogue-driven: pick a ``size`` and the chamber's nominal\ndimensions, masses, and silt-sump depth are read from\n``_CATALOGUE``. Override individual fields if a specific\nmanufacturer differs.\n\nThe catchpit is treated as a **manhole-family chamber** (same\nWorkCategory.MANHOLE) discriminated on chamber_type='catchpit'."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite assembly: precast concrete circular manhole with base slab, chamber rings (optional reducing slab + shaft), cover slab, frame & cover (BS EN 124 loading classes), step irons or ladder, in-situ benching with pre-formed channel, granular surround, geotextile separator, and excavation. Supports both open-battered and sheet-piled excavations. Example params: internal_diameter=1.5 m (1–3), wall_thickness=0.15 m (0.1–0.25), invert_depth=3.5 m (0.5–12). Example call: {"params": {"internal_diameter": 1.5, "wall_thickness": 0.15, "invert_depth": 3.5}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_manhole",
"title": "Compute Precast Concrete Circular Manhole BoQ",
"description": "Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite assembly: precast concrete circular manhole with base slab, chamber rings (optional reducing slab + shaft), cover slab, frame & cover (BS EN 124 loading classes), step irons or ladder, in-situ benching with pre-formed channel, granular surround, geotextile separator, and excavation. Supports both open-battered and sheet-piled excavations. Example params: internal_diameter=1.5 m (1–3), wall_thickness=0.15 m (0.1–0.25), invert_depth=3.5 m (0.5–12). Example call: {\"params\": {\"internal_diameter\": 1.5, \"wall_thickness\": 0.15, \"invert_depth\": 3.5}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"quantity": {
"type": "integer",
"default": 1
},
"base_grade": {
"type": "string",
"default": "C32/40"
},
"access_type": {
"enum": [
"step_irons",
"ladder",
"none"
],
"type": "string",
"default": "step_irons"
},
"invert_depth": {
"type": "number",
"default": 3.5
},
"cover_loading": {
"enum": [
"A15",
"B125",
"C250",
"D400",
"E600",
"F900"
],
"type": "string",
"default": "D400"
},
"base_thickness": {
"type": "number",
"default": 0.2
},
"benching_grade": {
"type": "string",
"default": "C32/40"
},
"blinding_grade": {
"type": "string",
"default": "C8/10"
},
"wall_thickness": {
"type": "number",
"default": 0.15
},
"base_projection": {
"type": "number",
"default": 0.15
},
"cover_slab_grade": {
"type": "string",
"default": "C32/40"
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"has_reducing_slab": {
"type": "boolean",
"default": true
},
"internal_diameter": {
"type": "number",
"default": 1.5
},
"step_iron_spacing": {
"type": "number",
"default": 0.3
},
"surround_material": {
"type": "string",
"default": "20mm single-size aggregate"
},
"blinding_thickness": {
"type": "number",
"default": 0.075
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter"
},
"surround_thickness": {
"type": "number",
"default": 0.15
},
"cover_clear_opening": {
"type": "number",
"default": 0.6
},
"cover_slab_thickness": {
"type": "number",
"default": 0.2
},
"cover_to_top_of_slab": {
"type": "number",
"default": 0.075
},
"geotextile_full_wrap": {
"type": "boolean",
"default": true
},
"seating_rings_height": {
"type": "number",
"default": 0.15
},
"main_channel_diameter": {
"type": "number",
"default": 0.3
},
"reducing_slab_at_depth": {
"type": "number",
"default": 1.2
},
"reducing_slab_thickness": {
"type": "number",
"default": 0.225
},
"shaft_internal_diameter": {
"type": "number",
"default": 0.675
},
"working_space_each_side": {
"type": "number",
"default": 0.5
},
"benching_rebar_kg_per_m3": {
"type": "number",
"default": 60
},
"base_slab_rebar_kg_per_m3": {
"type": "number",
"default": 110
},
"cover_slab_rebar_kg_per_m3": {
"type": "number",
"default": 130
},
"sheet_pile_depth_below_formation": {
"type": "number",
"default": 1
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Fully monolithic precast concrete circular manhole comprising factory-cast base + bottom ring + integral benching + pre-formed channel as a single delivered unit (BS 5911-3), with stacked precast chamber rings, optional reducing slab and access shaft, precast cover slab, ductile-iron frame and cover (BS EN 124 loading classes), step irons cast into rings, granular or concrete bedding, granular surround, geotextile separator, and excavation. Catalogue-driven sizing from PMC_1200 (1200mm ID) to PMC_2400 (2400mm ID). Routes via manhole_type=precast_monolithic attribute discrimination through CESMM4 Class K.1.2.x, NRM2 33.7.5, MMHW 500.5.5-.8 (SHW Cl. 507), and SMM7 R12.3.1.x. Example params: invert_depth=3.5 m (0.5–12), bedding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.15 m (0.1–0.3). Example call: {"params": {"invert_depth": 3.5, "bedding_thickness_mm": 150, "bedding_overhang_m": 0.15}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a fully monolithic precast concrete manhole. Catalogue-driven: pick a ``size`` and the chamber's nominal dimensions, masses, and ring heights are read from ``_CATALOGUE``. Override individual fields if a specific manufacturer differs. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_manhole_precast",
"title": "Compute Precast Concrete Monolithic Manhole BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Fully monolithic precast concrete circular manhole comprising factory-cast base + bottom ring + integral benching + pre-formed channel as a single delivered unit (BS 5911-3), with stacked precast chamber rings, optional reducing slab and access shaft, precast cover slab, ductile-iron frame and cover (BS EN 124 loading classes), step irons cast into rings, granular or concrete bedding, granular surround, geotextile separator, and excavation. Catalogue-driven sizing from PMC_1200 (1200mm ID) to PMC_2400 (2400mm ID). Routes via manhole_type=precast_monolithic attribute discrimination through CESMM4 Class K.1.2.x, NRM2 33.7.5, MMHW 500.5.5-.8 (SHW Cl. 507), and SMM7 R12.3.1.x. Example params: invert_depth=3.5 m (0.5–12), bedding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.15 m (0.1–0.3). Example call: {\"params\": {\"invert_depth\": 3.5, \"bedding_thickness_mm\": 150, \"bedding_overhang_m\": 0.15}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"PMC_1200",
"PMC_1500",
"PMC_1800",
"PMC_2100",
"PMC_2400"
],
"type": "string",
"default": "PMC_1500",
"description": "Standard UK precast monolithic-base manhole chamber internal\ndiameters. Catalogued by Marshalls CPM, FP McCann, Stanton Bonna,\nand CPM Group. PMC1200 is the smallest commonly stocked monolithic\nbase; PMC2400 is the largest practical without bespoke order."
},
"quantity": {
"type": "integer",
"default": 1
},
"access_type": {
"enum": [
"step_irons",
"ladder",
"none"
],
"type": "string",
"default": "step_irons"
},
"ring_mass_t": {
"type": "number",
"default": null
},
"bedding_type": {
"enum": [
"granular",
"concrete"
],
"type": "string",
"default": "granular",
"description": "Bedding layer beneath a precast monolithic base."
},
"invert_depth": {
"type": "number",
"default": 3.5
},
"cover_loading": {
"enum": [
"A15",
"B125",
"C250",
"D400",
"E600",
"F900"
],
"type": "string",
"default": "D400",
"description": "BS EN 124 cover-and-frame loading classes."
},
"ring_height_m": {
"type": "number",
"default": null
},
"wall_thickness": {
"type": "number",
"default": null
},
"base_unit_mass_t": {
"type": "number",
"default": null
},
"cover_slab_grade": {
"type": "string",
"default": "C40/50"
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"has_reducing_slab": {
"type": "boolean",
"default": true
},
"internal_diameter": {
"type": "number",
"default": null
},
"step_iron_spacing": {
"type": "number",
"default": 0.3
},
"surround_material": {
"type": "string",
"default": "20mm single-size aggregate"
},
"base_unit_height_m": {
"type": "number",
"default": null
},
"bedding_overhang_m": {
"type": "number",
"default": 0.15
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter"
},
"surround_thickness": {
"type": "number",
"default": 0.15
},
"cover_clear_opening": {
"type": "number",
"default": 0.6
},
"bedding_thickness_mm": {
"type": "integer",
"default": 150
},
"cover_slab_thickness": {
"type": "number",
"default": 0.2
},
"cover_to_top_of_slab": {
"type": "number",
"default": 0.075
},
"geotextile_full_wrap": {
"type": "boolean",
"default": true
},
"seating_rings_height": {
"type": "number",
"default": 0.15
},
"bedding_concrete_grade": {
"type": "string",
"default": "C8/10"
},
"bedding_granular_class": {
"type": "string",
"default": "6N"
},
"reducing_slab_at_depth": {
"type": "number",
"default": 1.2
},
"reducing_slab_thickness": {
"type": "number",
"default": 0.225
},
"shaft_internal_diameter": {
"type": "number",
"default": 0.675
},
"working_space_each_side": {
"type": "number",
"default": 0.5
},
"sheet_pile_depth_below_formation": {
"type": "number",
"default": 1
}
},
"description": "Parameter form for a fully monolithic precast concrete manhole.\n\nCatalogue-driven: pick a ``size`` and the chamber's nominal\ndimensions, masses, and ring heights are read from ``_CATALOGUE``.\nOverride individual fields if a specific manufacturer differs."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Precast concrete box culvert run (Marshalls / FP McCann / CPM ranges, BS EN 14844 / BS 5911-3) of one of eight catalogue sizes from BC_600 (600 × 600mm) to BC_3000x2000 (3000 × 2000mm). Composes the precast units (N per run), concrete blinding bedding, geotextile separator, selected granular surround per SHW Cl. 503, and foundation excavation with optional sheet pile support. Optional headwall_attenuation_outlet (2nd use of S21) at each termination with independently parameter-selectable scour protection (rock armour, gabion mattress, concrete apron, or none). Routes BOX_CULVERT_UNIT via CESMM4 H.7.3/.4/.5 (precast concrete, size banded), NRM2 33.8.1/.2/.3, MMHW 500.12.1/.2/.3 (with Series 2500 signpost for large units per Volume 4 NG 25), and SMM7 R12.4.5/.6/.7. Example params: total_length_m=12 m (1–200), invert_depth_m=2.5 m (0.5–15), invert_gradient=0.005 (0–0.08). Example call: {"params": {"total_length_m": 12, "invert_depth_m": 2.5, "invert_gradient": 0.005}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a precast concrete box culvert run. Catalogue-driven: pick a ``size`` and the section's nominal span / height / mass / wall thickness are read from ``_CATALOGUE``. Override individual fields if a specific manufacturer differs. The run is composed of ``ceil(total_length_m / unit_… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_box_culvert",
"title": "Compute Precast Concrete Box Culvert BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Precast concrete box culvert run (Marshalls / FP McCann / CPM ranges, BS EN 14844 / BS 5911-3) of one of eight catalogue sizes from BC_600 (600 × 600mm) to BC_3000x2000 (3000 × 2000mm). Composes the precast units (N per run), concrete blinding bedding, geotextile separator, selected granular surround per SHW Cl. 503, and foundation excavation with optional sheet pile support. Optional headwall_attenuation_outlet (2nd use of S21) at each termination with independently parameter-selectable scour protection (rock armour, gabion mattress, concrete apron, or none). Routes BOX_CULVERT_UNIT via CESMM4 H.7.3/.4/.5 (precast concrete, size banded), NRM2 33.8.1/.2/.3, MMHW 500.12.1/.2/.3 (with Series 2500 signpost for large units per Volume 4 NG 25), and SMM7 R12.4.5/.6/.7. Example params: total_length_m=12 m (1–200), invert_depth_m=2.5 m (0.5–15), invert_gradient=0.005 (0–0.08). Example call: {\"params\": {\"total_length_m\": 12, \"invert_depth_m\": 2.5, \"invert_gradient\": 0.005}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"BC_600",
"BC_900",
"BC_1200",
"BC_1500x1200",
"BC_1800x1500",
"BC_2400x1800",
"BC_2400x2000",
"BC_3000x2000"
],
"type": "string",
"default": "BC_1500x1200",
"description": "Standard UK precast concrete box culvert sizes. Drawn from the\nMarshalls / FP McCann / CPM published ranges; values are the\nnominal clear span × clear height in millimetres. BS EN 14844 /\nBS 5911-3.\n\nEight catalogue sizes spanning the practical range:\n\n BC_600 — 600 × 600 (smallest; small watercourses)\n BC_900 — 900 × 900 (small; minor streams)\n BC_1200 — 1200 × 1200 (small; agricultural)\n BC_1500x1200 — 1500 × 1200 (medium; equine / accommodation)\n BC_1800x1500 — 1800 × 1500 (medium; main watercourses)\n BC_2400x1800 — 2400 × 1800 (large; pedestrian / livestock subway)\n BC_2400x2000 — 2400 × 2000 (large; pedestrian subway)\n BC_3000x2000 — 3000 × 2000 (largest practical without bespoke\n order; vehicular accommodation\n culvert / small bridge alternative)"
},
"span_mm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "integer",
"default": 1
},
"height_mm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"project_ref": {
"type": "string",
"default": "Box culvert"
},
"unit_mass_t": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit_length_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"chainage_label": {
"type": "string",
"default": ""
},
"invert_depth_m": {
"type": "number",
"default": 2.5
},
"total_length_m": {
"type": "number",
"default": 12
},
"invert_gradient": {
"type": "number",
"default": 0.005
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"surround_material": {
"type": "string",
"default": "Class 6N selected granular fill"
},
"wall_thickness_mm": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null
},
"bedding_overhang_m": {
"type": "number",
"default": 0.15
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter",
"description": "Excavation support method. OPEN_BATTER assumes side slopes per the\n``excavation_batter`` parameter (H:V); VERTICAL_SUPPORTED assumes\nsheet piles or trench boxes and emits EXCAVATION_SUPPORT m² items."
},
"has_upstream_headwall": {
"type": "boolean",
"default": true
},
"bedding_blinding_grade": {
"type": "string",
"default": "C20/25"
},
"upstream_headwall_size": {
"enum": [
"PHW_300",
"PHW_375",
"PHW_450",
"PHW_600",
"PHW_750",
"PHW_900",
"PHW_1050",
"PHW_1200",
"PHW_1500"
],
"type": "string",
"default": "PHW_900",
"description": "Standard UK precast headwall sizes, by outfall pipe internal diameter.\n\nThese bracket the offerings from Marshalls CPM, FP McCann, and\nStanton Bonna. The unit size determines the CESMM4 Class H sub-code\n(H.7.1 ≤ 1200mm, H.7.2 > 1200mm), the typical mass for handling\nplant requirements, and the bedding footprint."
},
"upstream_stone_size_mm": {
"type": "integer",
"default": 200
},
"has_downstream_headwall": {
"type": "boolean",
"default": true
},
"downstream_headwall_size": {
"enum": [
"PHW_300",
"PHW_375",
"PHW_450",
"PHW_600",
"PHW_750",
"PHW_900",
"PHW_1050",
"PHW_1200",
"PHW_1500"
],
"type": "string",
"default": "PHW_900",
"description": "Standard UK precast headwall sizes, by outfall pipe internal diameter.\n\nThese bracket the offerings from Marshalls CPM, FP McCann, and\nStanton Bonna. The unit size determines the CESMM4 Class H sub-code\n(H.7.1 ≤ 1200mm, H.7.2 > 1200mm), the typical mass for handling\nplant requirements, and the bedding footprint."
},
"downstream_stone_size_mm": {
"type": "integer",
"default": 200
},
"cover_to_top_of_culvert_m": {
"type": "number",
"default": 0.6
},
"upstream_headwall_bedding": {
"enum": [
"concrete_bed",
"granular_bed"
],
"type": "string",
"default": "concrete_bed",
"description": "Bedding type beneath a precast headwall.\n\nCONCRETE_BED uses mass concrete blinding (typically C8/10 or C16/20)\nunder the unit, providing a level rigid surface and tying the unit\nto the formation. Common for soft cohesive ground and where flow\nerosion under the unit is a risk.\n\nGRANULAR_BED uses imported Class 6N or 6P granular material per\nSHW Cl. 803, compacted and levelled. Common for non-erodible\ngranular soils where a concrete bed is unnecessary."
},
"upstream_scour_protection": {
"enum": [
"rock_armour",
"gabion_mattress",
"concrete_apron",
"none"
],
"type": "string",
"default": "rock_armour",
"description": "Scour protection variant downstream of the headwall outfall.\n\nROCK_ARMOUR is the existing headwall_precast variant (granular fill,\nrock armour blanket). GABION_MATTRESS and CONCRETE_APRON are the\nnew S21 extensions for higher-energy or longer-lasting requirements.\nNONE skips scour protection entirely (rare; only suitable for\ndischarge into a robust receiving channel like a piled concrete\nweir basin)."
},
"working_space_each_side_m": {
"type": "number",
"default": 0.6
},
"geotextile_separator_grade": {
"type": "string",
"default": "200 g/m²"
},
"downstream_headwall_bedding": {
"enum": [
"concrete_bed",
"granular_bed"
],
"type": "string",
"default": "concrete_bed",
"description": "Bedding type beneath a precast headwall.\n\nCONCRETE_BED uses mass concrete blinding (typically C8/10 or C16/20)\nunder the unit, providing a level rigid surface and tying the unit\nto the formation. Common for soft cohesive ground and where flow\nerosion under the unit is a risk.\n\nGRANULAR_BED uses imported Class 6N or 6P granular material per\nSHW Cl. 803, compacted and levelled. Common for non-erodible\ngranular soils where a concrete bed is unnecessary."
},
"downstream_scour_protection": {
"enum": [
"rock_armour",
"gabion_mattress",
"concrete_apron",
"none"
],
"type": "string",
"default": "rock_armour",
"description": "Scour protection variant downstream of the headwall outfall.\n\nROCK_ARMOUR is the existing headwall_precast variant (granular fill,\nrock armour blanket). GABION_MATTRESS and CONCRETE_APRON are the\nnew S21 extensions for higher-energy or longer-lasting requirements.\nNONE skips scour protection entirely (rare; only suitable for\ndischarge into a robust receiving channel like a piled concrete\nweir basin)."
},
"include_outlet_flow_control": {
"type": "boolean",
"default": false
},
"upstream_apron_thickness_mm": {
"type": "integer",
"default": 300
},
"upstream_scour_apron_width_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"bedding_blinding_thickness_mm": {
"type": "integer",
"default": 150
},
"downstream_apron_thickness_mm": {
"type": "integer",
"default": 300
},
"upstream_scour_apron_length_m": {
"type": "number",
"default": 2
},
"downstream_scour_apron_width_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"surround_thickness_each_side_m": {
"type": "number",
"default": 0.3
},
"downstream_scour_apron_length_m": {
"type": "number",
"default": 2.5
},
"upstream_headwall_bedding_grade": {
"type": "string",
"default": "C8/10"
},
"downstream_headwall_bedding_grade": {
"type": "string",
"default": "C8/10"
},
"sheet_pile_depth_below_formation_m": {
"type": "number",
"default": 1
}
},
"description": "Parameter form for a precast concrete box culvert run.\n\nCatalogue-driven: pick a ``size`` and the section's nominal\nspan / height / mass / wall thickness are read from ``_CATALOGUE``.\nOverride individual fields if a specific manufacturer differs.\n\nThe run is composed of ``ceil(total_length_m / unit_length_m)``\nprecast sections of the chosen size. Headwalls at each end are\noptional and each independently selectable, with the\nheadwall_attenuation_outlet sub-assembly owning its size, bedding,\noutlet ironmongery, and scour protection. Per the S23 spec, the\nheadwalls are emitted as fully separate sub-assemblies — their\nWorkItems carry their own ``source_assembly`` tag."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite drainage inlet: precast gully pot with trap, ductile-iron grating, optional kerb outlet, and a short connection drain to the carrier sewer. The connection drain re-uses the bedding primitive. Four-standard rendering with component-aware sub-codes (CESMM4 K.6.x, NRM2 33.8.x, MMHW 500.7.x, SMM7 R12.3.6.x). Example params: pot_internal_diameter_mm=450 mm (300–750), pot_depth_m=0.9 m (0.45–2.5), pot_wall_thickness_mm=60 mm (50–100). Example call: {"params": {"pot_internal_diameter_mm": 450, "pot_depth_m": 0.9, "pot_wall_thickness_mm": 60}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_gully",
"title": "Compute Highway / Curtilage Gully with Connection BoQ",
"description": "Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite drainage inlet: precast gully pot with trap, ductile-iron grating, optional kerb outlet, and a short connection drain to the carrier sewer. The connection drain re-uses the bedding primitive. Four-standard rendering with component-aware sub-codes (CESMM4 K.6.x, NRM2 33.8.x, MMHW 500.7.x, SMM7 R12.3.6.x). Example params: pot_internal_diameter_mm=450 mm (300–750), pot_depth_m=0.9 m (0.45–2.5), pot_wall_thickness_mm=60 mm (50–100). Example call: {\"params\": {\"pot_internal_diameter_mm\": 450, \"pot_depth_m\": 0.9, \"pot_wall_thickness_mm\": 60}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"quantity": {
"type": "integer",
"default": 1
},
"gully_type": {
"enum": [
"trapped_road_gully",
"untrapped_road_gully",
"yard_gully",
"kerb_inlet_gully"
],
"type": "string",
"default": "trapped_road_gully",
"description": "Style of gully."
},
"pot_depth_m": {
"type": "number",
"default": 0.9
},
"grating_type": {
"type": "string",
"default": "hinged ductile iron"
},
"bedding_grade": {
"type": "string",
"default": "C20/25"
},
"grating_loading": {
"enum": [
"A15",
"B125",
"C250",
"D400",
"E600"
],
"type": "string",
"default": "D400",
"description": "BS EN 124 loading class."
},
"has_kerb_outlet": {
"type": "boolean",
"default": false
},
"haunching_grade": {
"type": "string",
"default": "C20/25"
},
"connection_length_m": {
"type": "number",
"default": 2.5
},
"connection_material": {
"type": "string",
"default": "vitrified clay"
},
"formation_below_pot": {
"type": "number",
"default": 0.15
},
"pot_wall_thickness_mm": {
"type": "integer",
"default": 60
},
"connection_diameter_mm": {
"type": "integer",
"default": 150
},
"working_space_each_side": {
"type": "number",
"default": 0.3
},
"connection_bedding_class": {
"enum": [
"N",
"F",
"B",
"S",
"A",
"Z"
],
"type": "string",
"default": "B",
"description": "Geometric bedding class per HA 40/01 / BS EN 1610.\n\nListed in ascending order of structural support."
},
"grating_clear_opening_mm": {
"type": "integer",
"default": 425
},
"pot_internal_diameter_mm": {
"type": "integer",
"default": 450
},
"connection_bedding_context": {
"enum": [
"highway",
"building"
],
"type": "string",
"default": "highway",
"description": "Specification context for pipe bedding measurement.\n\nHIGHWAY — MMHW Series 500 / HA 40/01. Bedding clause references\n SHW Cl. 503. Class N/F/B/A common; Class S less so.\nBUILDING — NRM2 §33 / BS EN 1610. Class S is the typical default;\n Class A and Z used for deep or structural locations."
},
"connection_invert_at_gully_m": {
"type": "number",
"default": 0.85
},
"connection_wall_thickness_mm": {
"type": "integer",
"default": 25
},
"connection_invert_at_carrier_m": {
"type": "number",
"default": 1.25
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_headwall. Controlled attenuation outlet: precast concrete headwall plus outlet-control ironmongery (orifice plate, optional flap valve, weir overflow, penstock) and downstream scour protection. 2nd use of the bundle-with-shared-envelope pattern (template: combined_services_trench S14). Composes headwall_precast for the structural unit and bedding; emits ironmongery items as CONTRACTOR_INSTALL_PC_SUPPLY by default (3rd commercially significant PC-supply emitter after utility_chamber and utility_kiosk_base). Scour protection extended to three variants: rock armour, gabion mattress, concrete apron. Example params: orifice_diameter_mm=150 mm (20–600), orifice_target_discharge_ls=5 l/s (0.1–200), flap_valve_size_mm=0 mm (0–1200). Example call: {"params": {"orifice_diameter_mm": 150, "orifice_target_discharge_ls": 5, "flap_valve_size_mm": 0}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for an attenuation outlet headwall. Composes a precast headwall (size, bedding) with one always-present orifice plate and up to three optional outlet-control ironmongery items (flap valve, weir overflow, penstock), plus a scour protection variant. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_headwall_attenuation_outlet",
"title": "Compute Headwall — Attenuation Outlet BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_headwall. Controlled attenuation outlet: precast concrete headwall plus outlet-control ironmongery (orifice plate, optional flap valve, weir overflow, penstock) and downstream scour protection. 2nd use of the bundle-with-shared-envelope pattern (template: combined_services_trench S14). Composes headwall_precast for the structural unit and bedding; emits ironmongery items as CONTRACTOR_INSTALL_PC_SUPPLY by default (3rd commercially significant PC-supply emitter after utility_chamber and utility_kiosk_base). Scour protection extended to three variants: rock armour, gabion mattress, concrete apron. Example params: orifice_diameter_mm=150 mm (20–600), orifice_target_discharge_ls=5 l/s (0.1–200), flap_valve_size_mm=0 mm (0–1200). Example call: {\"params\": {\"orifice_diameter_mm\": 150, \"orifice_target_discharge_ls\": 5, \"flap_valve_size_mm\": 0}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"PHW_300",
"PHW_375",
"PHW_450",
"PHW_600",
"PHW_750",
"PHW_900",
"PHW_1050",
"PHW_1200",
"PHW_1500"
],
"type": "string",
"default": "PHW_600",
"description": "Standard UK precast headwall sizes, by outfall pipe internal diameter.\n\nThese bracket the offerings from Marshalls CPM, FP McCann, and\nStanton Bonna. The unit size determines the CESMM4 Class H sub-code\n(H.7.1 ≤ 1200mm, H.7.2 > 1200mm), the typical mass for handling\nplant requirements, and the bedding footprint."
},
"quantity": {
"type": "integer",
"default": 1
},
"project_ref": {
"type": "string",
"default": "Attenuation Outlet"
},
"bedding_type": {
"enum": [
"concrete_bed",
"granular_bed"
],
"type": "string",
"default": "concrete_bed",
"description": "Bedding type beneath a precast headwall.\n\nCONCRETE_BED uses mass concrete blinding (typically C8/10 or C16/20)\nunder the unit, providing a level rigid surface and tying the unit\nto the formation. Common for soft cohesive ground and where flow\nerosion under the unit is a risk.\n\nGRANULAR_BED uses imported Class 6N or 6P granular material per\nSHW Cl. 803, compacted and levelled. Common for non-erodible\ngranular soils where a concrete bed is unnecessary."
},
"has_penstock": {
"type": "boolean",
"default": false
},
"supply_route": {
"anyOf": [
{
"enum": [
"contractor_full",
"contractor_install_pc_supply",
"provisional_sum",
"utility_provider_supply",
"employer_direct"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"chainage_label": {
"type": "string",
"default": ""
},
"has_flap_valve": {
"type": "boolean",
"default": false
},
"penstock_size_mm": {
"type": "integer",
"default": 0
},
"gabion_mesh_grade": {
"type": "string",
"default": "Type A galfan PVC-coated mesh to BS EN 10223-3"
},
"has_weir_overflow": {
"type": "boolean",
"default": false
},
"flap_valve_size_mm": {
"type": "integer",
"default": 0
},
"orifice_diameter_mm": {
"type": "integer",
"default": 150
},
"scour_apron_width_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"scour_stone_size_mm": {
"type": "integer",
"default": 200
},
"concrete_apron_grade": {
"type": "string",
"default": "C32/40"
},
"orifice_manufacturer": {
"type": "string",
"default": "generic"
},
"scour_apron_length_m": {
"type": "number",
"default": 2
},
"scour_protection_type": {
"enum": [
"rock_armour",
"gabion_mattress",
"concrete_apron",
"none"
],
"type": "string",
"default": "rock_armour",
"description": "Scour protection variant downstream of the headwall outfall.\n\nROCK_ARMOUR is the existing headwall_precast variant (granular fill,\nrock armour blanket). GABION_MATTRESS and CONCRETE_APRON are the\nnew S21 extensions for higher-energy or longer-lasting requirements.\nNONE skips scour protection entirely (rare; only suitable for\ndischarge into a robust receiving channel like a piled concrete\nweir basin)."
},
"concrete_bedding_grade": {
"type": "string",
"default": "C8/10"
},
"scour_blanket_thickness_m": {
"type": "number",
"default": 0.3
},
"orifice_target_discharge_ls": {
"type": "number",
"default": 5
},
"weir_overflow_crest_height_m": {
"type": "number",
"default": 0.5
},
"weir_overflow_crest_length_m": {
"type": "number",
"default": 1
}
},
"description": "Parameter form for an attenuation outlet headwall.\n\nComposes a precast headwall (size, bedding) with one always-present\norifice plate and up to three optional outlet-control ironmongery\nitems (flap valve, weir overflow, penstock), plus a scour\nprotection variant."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_headwall. Precast concrete outfall headwall, supplied as a whole unit from a UK manufacturer (Marshalls CPM, FP McCann, Stanton Bonna or equivalent). Catalogue-driven sizing from PHW_300 (300mm pipe ID) to PHW_1500 (1500mm). Includes excavation, concrete or granular bedding, and optional rock-armour scour protection. Routes precast unit through CESMM4 Class H, NRM2 33.9.1, MMHW 500.8.1 (SHW Cl. 511), and SMM7 R12.3.7 via headwall_type=precast attribute discrimination. Example params: bedding_thickness_mm=150 mm (75–300), bedding_overhang_m=0.15 m (0.075–0.3), working_space_each_side_m=0.45 m (0.3–1.5). Example call: {"params": {"bedding_thickness_mm": 150, "bedding_overhang_m": 0.15, "working_space_each_side_m": 0.45}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a precast headwall. Catalogue-driven: pick a `size` and the unit's nominal physical dimensions are read from `_CATALOGUE`. Override individual physical fields if a specific manufacturer differs. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_headwall_precast",
"title": "Compute Precast Concrete Outfall Headwall BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_headwall. Precast concrete outfall headwall, supplied as a whole unit from a UK manufacturer (Marshalls CPM, FP McCann, Stanton Bonna or equivalent). Catalogue-driven sizing from PHW_300 (300mm pipe ID) to PHW_1500 (1500mm). Includes excavation, concrete or granular bedding, and optional rock-armour scour protection. Routes precast unit through CESMM4 Class H, NRM2 33.9.1, MMHW 500.8.1 (SHW Cl. 511), and SMM7 R12.3.7 via headwall_type=precast attribute discrimination. Example params: bedding_thickness_mm=150 mm (75–300), bedding_overhang_m=0.15 m (0.075–0.3), working_space_each_side_m=0.45 m (0.3–1.5). Example call: {\"params\": {\"bedding_thickness_mm\": 150, \"bedding_overhang_m\": 0.15, \"working_space_each_side_m\": 0.45}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"PHW_300",
"PHW_375",
"PHW_450",
"PHW_600",
"PHW_750",
"PHW_900",
"PHW_1050",
"PHW_1200",
"PHW_1500"
],
"type": "string",
"default": "PHW_600",
"description": "Standard UK precast headwall sizes, by outfall pipe internal diameter.\n\nThese bracket the offerings from Marshalls CPM, FP McCann, and\nStanton Bonna. The unit size determines the CESMM4 Class H sub-code\n(H.7.1 ≤ 1200mm, H.7.2 > 1200mm), the typical mass for handling\nplant requirements, and the bedding footprint."
},
"quantity": {
"type": "integer",
"default": 1
},
"unit_mass_t": {
"type": "number",
"default": null
},
"bedding_type": {
"enum": [
"concrete_bed",
"granular_bed"
],
"type": "string",
"default": "concrete_bed",
"description": "Bedding type beneath a precast headwall.\n\nCONCRETE_BED uses mass concrete blinding (typically C8/10 or C16/20)\nunder the unit, providing a level rigid surface and tying the unit\nto the formation. Common for soft cohesive ground and where flow\nerosion under the unit is a risk.\n\nGRANULAR_BED uses imported Class 6N or 6P granular material per\nSHW Cl. 803, compacted and levelled. Common for non-erodible\ngranular soils where a concrete bed is unnecessary."
},
"unit_depth_m": {
"type": "number",
"default": null
},
"unit_width_m": {
"type": "number",
"default": null
},
"apron_width_m": {
"type": "number",
"default": null
},
"unit_height_m": {
"type": "number",
"default": null
},
"apron_length_m": {
"type": "number",
"default": null
},
"bedding_overhang_m": {
"type": "number",
"default": 0.15
},
"scour_apron_width_m": {
"type": "number",
"default": null
},
"scour_stone_size_mm": {
"type": "integer",
"default": 200
},
"bedding_thickness_mm": {
"type": "integer",
"default": 150
},
"has_scour_protection": {
"type": "boolean",
"default": true
},
"scour_apron_length_m": {
"type": "number",
"default": 2
},
"concrete_bedding_grade": {
"type": "string",
"default": "C8/10"
},
"granular_bedding_class": {
"type": "string",
"default": "6N"
},
"formation_below_bedding_m": {
"type": "number",
"default": 0.075
},
"pipe_internal_diameter_mm": {
"type": "integer",
"default": null
},
"scour_blanket_thickness_m": {
"type": "number",
"default": 0.3
},
"working_space_each_side_m": {
"type": "number",
"default": 0.45
}
},
"description": "Parameter form for a precast headwall.\n\nCatalogue-driven: pick a `size` and the unit's nominal physical\ndimensions are read from `_CATALOGUE`. Override individual physical\nfields if a specific manufacturer differs."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite RC outfall headwall: back wall pierced by the outfall pipe, splayed wing walls flaring downstream, apron slab, and rock-armour scour protection. In-situ or precast construction; BS 8666:2020 bar schedule composed across back wall, apron and wing walls. Four-standard rendering across CESMM4 / NRM2 / MMHW / SMM7. Example params: pipe_internal_diameter_mm=300 mm (100–1800), pipe_wall_thickness_mm=50 mm (15–120), invert_below_apron_m=0 m (0–1.5). Example call: {"params": {"pipe_internal_diameter_mm": 300, "pipe_wall_thickness_mm": 50, "invert_below_apron_m": 0}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_headwall",
"title": "Compute Reinforced Concrete Outfall Headwall BoQ",
"description": "Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Composite RC outfall headwall: back wall pierced by the outfall pipe, splayed wing walls flaring downstream, apron slab, and rock-armour scour protection. In-situ or precast construction; BS 8666:2020 bar schedule composed across back wall, apron and wing walls. Four-standard rendering across CESMM4 / NRM2 / MMHW / SMM7. Example params: pipe_internal_diameter_mm=300 mm (100–1800), pipe_wall_thickness_mm=50 mm (15–120), invert_below_apron_m=0 m (0–1.5). Example call: {\"params\": {\"pipe_internal_diameter_mm\": 300, \"pipe_wall_thickness_mm\": 50, \"invert_below_apron_m\": 0}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"cover_mm": {
"type": "integer",
"default": 50
},
"quantity": {
"type": "integer",
"default": 1
},
"apron_length": {
"type": "number",
"default": 2
},
"headwall_type": {
"enum": [
"in_situ",
"precast"
],
"type": "string",
"default": "in_situ",
"description": "Construction method for the headwall."
},
"apron_overhang": {
"type": "number",
"default": 0.3
},
"blinding_grade": {
"type": "string",
"default": "C8/10"
},
"concrete_grade": {
"type": "string",
"default": "C32/40"
},
"apron_thickness": {
"type": "number",
"default": 0.25
},
"back_wall_height": {
"type": "number",
"default": 1.5
},
"back_wall_length": {
"type": "number",
"default": 2.5
},
"wing_wall_height": {
"type": "number",
"default": 1.5
},
"wing_wall_length": {
"type": "number",
"default": 1.5
},
"scour_apron_width": {
"type": "number",
"default": 4
},
"scour_apron_length": {
"type": "number",
"default": 2
},
"back_wall_thickness": {
"type": "number",
"default": 0.3
},
"scour_stone_size_mm": {
"type": "integer",
"default": 200
},
"wing_wall_splay_deg": {
"type": "number",
"default": 30
},
"wing_wall_thickness": {
"type": "number",
"default": 0.25
},
"has_scour_protection": {
"type": "boolean",
"default": true
},
"invert_below_apron_m": {
"type": "number",
"default": 0
},
"wing_wall_tip_height": {
"type": "number",
"default": 0.3
},
"apron_main_bar_dia_mm": {
"type": "integer",
"default": 12
},
"formation_below_apron": {
"type": "number",
"default": 0.075
},
"pipe_wall_thickness_mm": {
"type": "integer",
"default": 50
},
"apron_main_bar_pitch_mm": {
"type": "integer",
"default": 200
},
"scour_blanket_thickness": {
"type": "number",
"default": 0.3
},
"working_space_each_side": {
"type": "number",
"default": 0.45
},
"back_wall_main_bar_dia_mm": {
"type": "integer",
"default": 16
},
"pipe_internal_diameter_mm": {
"type": "integer",
"default": 300
},
"wing_wall_main_bar_dia_mm": {
"type": "integer",
"default": 12
},
"back_wall_main_bar_pitch_mm": {
"type": "integer",
"default": 200
},
"wing_wall_main_bar_pitch_mm": {
"type": "integer",
"default": 200
},
"apron_distribution_bar_dia_mm": {
"type": "integer",
"default": 12
},
"apron_distribution_bar_pitch_mm": {
"type": "integer",
"default": 200
},
"back_wall_distribution_bar_dia_mm": {
"type": "integer",
"default": 12
},
"back_wall_distribution_bar_pitch_mm": {
"type": "integer",
"default": 200
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear carrier-pipe measurement assembly with full four-standard depth-banded rendering. CESMM4 Class I (I.{material}.{bore}.{depth}, 9 depth bands), NRM2 Group 33 (33.1.{bore}.{depth}, equivalent banding), MMHW Series 500 (500.1.{bore}.{depth}, 11 depth bands extending to 6 m for highway-scale carriers per SHW Cl. 501), SMM7 R12 (R12.1.{bore}.{depth}, 10 depth bands starting at 1 m for housing-scale carriers). Twelve variant presets exercise all 9 CESMM4 Class I depth bands and all 5 carrier materials (vitrified clay / concrete / HDPE / ductile iron / uPVC) — 12 × 4 = 48 distinguishable BoQ rows from a single parameter form. 19th use of the classed-then-legacy attribute discrimination pattern, FIRST applied to a Class I (Pipework) category — discriminator here is `material` itself, with the CESMM4 handler routing through the 5 Class I material sub-class digits while NRM2/MMHW/SMM7 stay within their respective groups but distinguish material in the description. Companion assembly: connection_to_existing (S32 sibling pair) — the enumerated extra-over connection line that ties a carrier run into an adopted asset. Example params: diameter_mm=225 mm (100–2400), invert_depth_m=1.8 m (0.5–10), run_length_m=30 m (1–2000). Example call: {"params": {"diameter_mm": 225, "invert_depth_m": 1.8, "run_length_m": 30}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a carrier pipe run. Geometric defaults yield a DN225 vitrified clay carrier at 1.8 m average invert depth over a 30 m run — the textbook small-civils foul carrier described in the QS measurement examples. |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_carrier_pipe_run",
"title": "Compute Carrier Pipe Run (banded) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear carrier-pipe measurement assembly with full four-standard depth-banded rendering. CESMM4 Class I (I.{material}.{bore}.{depth}, 9 depth bands), NRM2 Group 33 (33.1.{bore}.{depth}, equivalent banding), MMHW Series 500 (500.1.{bore}.{depth}, 11 depth bands extending to 6 m for highway-scale carriers per SHW Cl. 501), SMM7 R12 (R12.1.{bore}.{depth}, 10 depth bands starting at 1 m for housing-scale carriers). Twelve variant presets exercise all 9 CESMM4 Class I depth bands and all 5 carrier materials (vitrified clay / concrete / HDPE / ductile iron / uPVC) — 12 × 4 = 48 distinguishable BoQ rows from a single parameter form. 19th use of the classed-then-legacy attribute discrimination pattern, FIRST applied to a Class I (Pipework) category — discriminator here is `material` itself, with the CESMM4 handler routing through the 5 Class I material sub-class digits while NRM2/MMHW/SMM7 stay within their respective groups but distinguish material in the description. Companion assembly: connection_to_existing (S32 sibling pair) — the enumerated extra-over connection line that ties a carrier run into an adopted asset. Example params: diameter_mm=225 mm (100–2400), invert_depth_m=1.8 m (0.5–10), run_length_m=30 m (1–2000). Example call: {\"params\": {\"diameter_mm\": 225, \"invert_depth_m\": 1.8, \"run_length_m\": 30}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"use": {
"enum": [
"housing lateral",
"estate carrier",
"site carrier",
"district trunk",
"urban trunk",
"combined sewer main",
"rising main"
],
"type": "string",
"default": "estate carrier",
"description": "Functional use of the carrier pipe — informs description text.\nDoes NOT change the BoQ code (the codes are governed by material,\nbore and depth only). Use is reflected in the description so the\nQS reading the priced bill can see which run is which."
},
"jointing": {
"enum": [
"flexible elastomeric",
"electrofusion",
"push-fit gasket",
"solvent weld"
],
"type": "string",
"default": "flexible elastomeric",
"description": "How sections of the run are jointed end-to-end."
},
"material": {
"enum": [
"vitrified clay",
"concrete",
"hdpe",
"ductile iron",
"upvc"
],
"type": "string",
"default": "vitrified clay",
"description": "Carrier pipe material families per BS EN standards. Maps to the\nClass I material sub-class digits 1-6 in the CESMM4 renderer\n(see _CESMM4_CLASS_I_MATERIAL_DIGIT)."
},
"diameter_mm": {
"type": "integer",
"default": 225
},
"run_length_m": {
"type": "number",
"default": 30
},
"invert_depth_m": {
"type": "number",
"default": 1.8
},
"description_override": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Parameters for a carrier pipe run.\n\nGeometric defaults yield a DN225 vitrified clay carrier at 1.8 m\naverage invert depth over a 30 m run — the textbook small-civils\nfoul carrier described in the QS measurement examples."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Perforated land drain in a granular-filled trench with non-woven filter geotextile wrap. Composes the bedding primitive at Class S geometry (full granular envelope) with three additions: perforated carrier, filter geotextile wrap, and optional top seal. Renders cleanly across CESMM4 / NRM2 / MMHW (Series 500 filter drain) and SMM7. Example params: pipe_internal_diameter_mm=150 mm (80–600), pipe_wall_thickness_mm=25 mm (5–80), drain_length=50 m (1–500). Example call: {"params": {"pipe_internal_diameter_mm": 150, "pipe_wall_thickness_mm": 25, "drain_length": 50}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_french_drain",
"title": "Compute French (Filter) Drain BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Perforated land drain in a granular-filled trench with non-woven filter geotextile wrap. Composes the bedding primitive at Class S geometry (full granular envelope) with three additions: perforated carrier, filter geotextile wrap, and optional top seal. Renders cleanly across CESMM4 / NRM2 / MMHW (Series 500 filter drain) and SMM7. Example params: pipe_internal_diameter_mm=150 mm (80–600), pipe_wall_thickness_mm=25 mm (5–80), drain_length=50 m (1–500). Example call: {\"params\": {\"pipe_internal_diameter_mm\": 150, \"pipe_wall_thickness_mm\": 25, \"drain_length\": 50}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"pipe_type": {
"enum": [
"hdpe_twin_wall",
"clay_perforated",
"upvc_slotted"
],
"type": "string",
"default": "hdpe_twin_wall",
"description": "Perforated carrier pipe type."
},
"drain_length": {
"type": "number",
"default": 50
},
"has_top_seal": {
"type": "boolean",
"default": false
},
"invert_depth": {
"type": "number",
"default": 1
},
"bedding_context": {
"enum": [
"highway",
"building"
],
"type": "string",
"default": "highway",
"description": "Specification context for pipe bedding measurement.\n\nHIGHWAY — MMHW Series 500 / HA 40/01. Bedding clause references\n SHW Cl. 503. Class N/F/B/A common; Class S less so.\nBUILDING — NRM2 §33 / BS EN 1610. Class S is the typical default;\n Class A and Z used for deep or structural locations."
},
"has_filter_wrap": {
"type": "boolean",
"default": true
},
"filter_aggregate": {
"type": "string",
"default": "Type B filter (20-40mm)"
},
"cover_above_crown": {
"type": "number",
"default": 0.45
},
"excavation_batter": {
"type": "number",
"default": 1
},
"top_seal_thickness": {
"type": "number",
"default": 0.15
},
"trench_width_extra": {
"type": "number",
"default": 0.3
},
"filter_aggregate_class": {
"type": "string",
"default": "Class 6N"
},
"pipe_wall_thickness_mm": {
"type": "integer",
"default": 25
},
"filter_geotextile_grade": {
"type": "string",
"default": "150 g/m² non-woven"
},
"working_space_each_side": {
"type": "number",
"default": 0.15
},
"pipe_internal_diameter_mm": {
"type": "integer",
"default": 150
},
"excavation_support_required": {
"type": "boolean",
"default": false
},
"bedding_thickness_below_pipe": {
"type": "number",
"default": 0.15
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Highway pavement edge drain per HD 33/16. Perforated carrier in a granular-filled trench with filter geotextile wrap; optional top separator under the pavement build-up. Highway-specific defaults: Type B filter aggregate, 200 g/m² geotextile, supported excavation. Headline standard mapping: MMHW 500.7 (filter drain with perforated pipe). Renders cleanly across all four standards with HA 40/01 references. Example params: pipe_internal_diameter_mm=150 mm (80–300), pipe_wall_thickness_mm=25 mm (5–50), drain_length=100 m (1–1000). Example call: {"params": {"pipe_internal_diameter_mm": 150, "pipe_wall_thickness_mm": 25, "drain_length": 100}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_edge_drain",
"title": "Compute Highway Pavement Edge Drain (HD 33/16) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Highway pavement edge drain per HD 33/16. Perforated carrier in a granular-filled trench with filter geotextile wrap; optional top separator under the pavement build-up. Highway-specific defaults: Type B filter aggregate, 200 g/m² geotextile, supported excavation. Headline standard mapping: MMHW 500.7 (filter drain with perforated pipe). Renders cleanly across all four standards with HA 40/01 references. Example params: pipe_internal_diameter_mm=150 mm (80–300), pipe_wall_thickness_mm=25 mm (5–50), drain_length=100 m (1–1000). Example call: {\"params\": {\"pipe_internal_diameter_mm\": 150, \"pipe_wall_thickness_mm\": 25, \"drain_length\": 100}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"pipe_type": {
"enum": [
"hdpe_twin_wall",
"clay_perforated"
],
"type": "string",
"default": "hdpe_twin_wall",
"description": "Perforated carrier — same enum as French drain for consistency."
},
"drain_length": {
"type": "number",
"default": 100
},
"invert_depth": {
"type": "number",
"default": 0.8
},
"has_filter_wrap": {
"type": "boolean",
"default": true
},
"cover_above_crown": {
"type": "number",
"default": 0.35
},
"excavation_batter": {
"type": "number",
"default": 1
},
"has_top_separator": {
"type": "boolean",
"default": true
},
"trench_width_extra": {
"type": "number",
"default": 0.3
},
"top_separator_grade": {
"type": "string",
"default": "200 g/m² non-woven separator (SHW Cl. 624)"
},
"filter_aggregate_type": {
"enum": [
"type_b_6f2",
"type_a_6f1"
],
"type": "string",
"default": "type_b_6f2",
"description": "Filter aggregate per SHW Series 500 / SHW Cl. 513."
},
"pipe_wall_thickness_mm": {
"type": "integer",
"default": 25
},
"filter_geotextile_grade": {
"type": "string",
"default": "200 g/m² non-woven (SHW Cl. 513)"
},
"working_space_each_side": {
"type": "number",
"default": 0.1
},
"pipe_internal_diameter_mm": {
"type": "integer",
"default": 150
},
"excavation_support_required": {
"type": "boolean",
"default": true
},
"bedding_thickness_below_pipe": {
"type": "number",
"default": 0.15
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear pipe trench with class-driven bedding and surround. Strategy pattern on (BeddingContext × BeddingClass): Highway (HA 40/01 / MMHW Series 500) vs Building (BS EN 1610 / NRM2 §33), Class N/F/B/S/A/Z. Emits trench excavation, granular bed, surround or concrete cradle/encasement, selected backfill, disposal and pipework. All four standards render with class and clause references. Example params: pipe_internal_diameter_mm=300 mm (100–1800), pipe_wall_thickness_mm=50 mm (10–200), pipe_length=25 m (1–500). Example call: {"params": {"pipe_internal_diameter_mm": 300, "pipe_wall_thickness_mm": 50, "pipe_length": 25}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_pipe_bedding",
"title": "Compute Pipe Bedding and Surround BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Linear pipe trench with class-driven bedding and surround. Strategy pattern on (BeddingContext × BeddingClass): Highway (HA 40/01 / MMHW Series 500) vs Building (BS EN 1610 / NRM2 §33), Class N/F/B/S/A/Z. Emits trench excavation, granular bed, surround or concrete cradle/encasement, selected backfill, disposal and pipework. All four standards render with class and clause references. Example params: pipe_internal_diameter_mm=300 mm (100–1800), pipe_wall_thickness_mm=50 mm (10–200), pipe_length=25 m (1–500). Example call: {\"params\": {\"pipe_internal_diameter_mm\": 300, \"pipe_wall_thickness_mm\": 50, \"pipe_length\": 25}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"pipe_length": {
"type": "number",
"default": 25
},
"invert_depth": {
"type": "number",
"default": 1.5
},
"bedding_class": {
"enum": [
"N",
"F",
"B",
"S",
"A",
"Z"
],
"type": "string",
"default": "B",
"description": "Geometric bedding class per HA 40/01 / BS EN 1610.\n\nListed in ascending order of structural support."
},
"pipe_material": {
"enum": [
"vitrified_clay",
"hdpe",
"upvc",
"concrete",
"ductile_iron"
],
"type": "string",
"default": "vitrified_clay",
"description": "Carrier pipe material."
},
"backfill_class": {
"type": "string",
"default": "Class 2A general fill"
},
"bedding_context": {
"enum": [
"highway",
"building"
],
"type": "string",
"default": "highway",
"description": "Specification context for pipe bedding measurement.\n\nHIGHWAY — MMHW Series 500 / HA 40/01. Bedding clause references\n SHW Cl. 503. Class N/F/B/A common; Class S less so.\nBUILDING — NRM2 §33 / BS EN 1610. Class S is the typical default;\n Class A and Z used for deep or structural locations."
},
"cover_above_crown": {
"type": "number",
"default": 0.15
},
"excavation_batter": {
"type": "number",
"default": 1
},
"trench_width_extra": {
"type": "number",
"default": 0.3
},
"pipe_wall_thickness_mm": {
"type": "integer",
"default": 50
},
"working_space_each_side": {
"type": "number",
"default": 0.15
},
"pipe_internal_diameter_mm": {
"type": "integer",
"default": 300
},
"excavation_support_required": {
"type": "boolean",
"default": false
},
"bedding_thickness_below_pipe": {
"type": "number",
"default": 0.15
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_attenuation_tank. Infiltration soakaway per CIRIA C753 Chapter 25. Granular-fill or modular-crate storage envelope with infiltration discharge through the base and side walls. Wraps attenuation_tank for the storage envelope and emits an INFILTRATION_SURFACE item plus optional PERFORATED_DISTRIBUTION_PIPE on top. Includes the C753 rational-method sizing engine with hot-spot and cold-spot factors of safety per C753 Tables 25.4 / 25.5; the engine refuses to size for VERY_HIGH hot-spot catchments (fuel forecourts, lorry parks) which C753 prohibits from direct infiltration without pre-treatment. Half-emptying time checked against the 24h C753 §25.4 limit. Renders cleanly across CESMM4 / NRM2 / MMHW / SMM7 using existing earthworks / drainage handlers plus the two new categories (INFILTRATION_SURFACE, PERFORATED_DISTRIBUTION_PIPE) added in S22. Example params: catchment_area_m2=500 m² (10–10000), rainfall_depth_mm=60 mm (10–300), measured_infiltration_rate_m_per_s=0.0001 m/s (1e-07–0.01). Example call: {"params": {"catchment_area_m2": 500, "rainfall_depth_mm": 60, "measured_infiltration_rate_m_per_s": 0.0001}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a CIRIA C753 infiltration soakaway. Two ways to specify the design storm: (a) ``design_storm_volume_m3`` directly (from an upstream MicroDrainage / InfoWorks ICM model) — preferred for any catchment > 1 ha or where the upstream model is the design-of-record. (… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_soakaway",
"title": "Compute Infiltration Soakaway (CIRIA C753) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_attenuation_tank. Infiltration soakaway per CIRIA C753 Chapter 25. Granular-fill or modular-crate storage envelope with infiltration discharge through the base and side walls. Wraps attenuation_tank for the storage envelope and emits an INFILTRATION_SURFACE item plus optional PERFORATED_DISTRIBUTION_PIPE on top. Includes the C753 rational-method sizing engine with hot-spot and cold-spot factors of safety per C753 Tables 25.4 / 25.5; the engine refuses to size for VERY_HIGH hot-spot catchments (fuel forecourts, lorry parks) which C753 prohibits from direct infiltration without pre-treatment. Half-emptying time checked against the 24h C753 §25.4 limit. Renders cleanly across CESMM4 / NRM2 / MMHW / SMM7 using existing earthworks / drainage handlers plus the two new categories (INFILTRATION_SURFACE, PERFORATED_DISTRIBUTION_PIPE) added in S22. Example params: catchment_area_m2=500 m² (10–10000), rainfall_depth_mm=60 mm (10–300), measured_infiltration_rate_m_per_s=0.0001 m/s (1e-07–0.01). Example call: {\"params\": {\"catchment_area_m2\": 500, \"rainfall_depth_mm\": 60, \"measured_infiltration_rate_m_per_s\": 0.0001}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"hot_spot": {
"enum": [
"low",
"medium",
"high",
"very_high"
],
"type": "string",
"default": "low",
"description": "CIRIA C753 §25.5 / Table 25.5 hot-spot land-use categories.\n\nA \"hot spot\" is a catchment area whose runoff carries elevated\npollution risk — primarily hydrocarbons (fuel, oil), heavy metals\n(from brake wear, tyre wear), or de-icing chemicals. C753 requires\nenhanced treatment OR a discount on the infiltration rate (more\ntreatment time in the soil) for hot-spot catchments.\n\nThe values below match C753 Table 25.5 categorisation:\n\n LOW — residential, footways, amenity (no discount)\n MEDIUM — car parks, minor roads, supermarket forecourts\n HIGH — A-roads, large car parks, HGV access, industrial yards\n VERY_HIGH — fuel forecourts, lorry parks, vehicle workshops, depots\n (NB: C753 may direct that infiltration is NOT\n permitted at all without pre-treatment)"
},
"quantity": {
"type": "integer",
"default": 1
},
"soil_type": {
"type": "string",
"default": "silty sand"
},
"tank_type": {
"enum": [
"crate",
"pipes"
],
"type": "string",
"default": "crate"
},
"confidence": {
"enum": [
"low",
"medium",
"high"
],
"type": "string",
"default": "medium",
"description": "CIRIA C753 Table 25.4 confidence categories for the\nfactor-of-safety on the as-measured infiltration rate.\n\nThe factor compensates for spatial heterogeneity in soil\npermeability, seasonal water-table variation, and long-term\nclogging by fines.\n\n LOW — single soakage test, FoS = 10\n MEDIUM — 2-3 tests, FoS = 4\n HIGH — ≥3 tests with consistent results + groundwater\n monitoring, FoS = 2"
},
"void_ratio": {
"type": "number",
"default": 0.3
},
"project_ref": {
"type": "string",
"default": "Soakaway"
},
"plan_width_m": {
"type": "number",
"default": 5
},
"plan_length_m": {
"type": "number",
"default": 10
},
"chainage_label": {
"type": "string",
"default": ""
},
"storage_depth_m": {
"type": "number",
"default": 2
},
"crate_void_ratio": {
"type": "number",
"default": 0.95
},
"catchment_area_m2": {
"type": "number",
"default": 500
},
"cover_to_tank_top": {
"type": "number",
"default": 0.5
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"rainfall_depth_mm": {
"type": "number",
"default": 60
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter"
},
"runoff_surface_type": {
"enum": [
"hard_impermeable",
"hard_permeable",
"gravel",
"grass",
"pervious_paving"
],
"type": "string",
"default": "hard_impermeable",
"description": "Runoff coefficient categories per BRE 365 / C753 Table 24.1.\nUsed when ``design_storm_volume_m3`` is computed from catchment\narea rather than supplied directly.\n\nValues map to typical Cv (volumetric runoff coefficient) for the\nUK climate and design storm range; the engine uses these as\ndefaults but a user can override."
},
"has_distribution_pipe": {
"type": "boolean",
"default": true
},
"design_storm_volume_m3": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"working_space_each_side": {
"type": "number",
"default": 0.6
},
"distribution_pipe_length_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"distribution_pipe_material": {
"type": "string",
"default": "perforated HDPE"
},
"runoff_coefficient_override": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"distribution_pipe_diameter_mm": {
"type": "integer",
"default": 150
},
"measured_infiltration_rate_m_per_s": {
"type": "number",
"default": 0.0001
}
},
"description": "Parameters for a CIRIA C753 infiltration soakaway.\n\nTwo ways to specify the design storm:\n\n (a) ``design_storm_volume_m3`` directly (from an upstream\n MicroDrainage / InfoWorks ICM model) — preferred for any\n catchment > 1 ha or where the upstream model is the\n design-of-record.\n\n (b) ``catchment_area_m2`` + ``rainfall_depth_mm`` +\n ``runoff_surface_type`` (or ``runoff_coefficient_override``)\n — the rational-method shortcut, appropriate for small-catchment\n soakaways (housing estate, supermarket forecourt, small\n commercial yard) where a senior QS / drainage engineer\n would sketch the design from these three numbers.\n\nIf both are specified, ``design_storm_volume_m3`` wins.\n\nSoil characterisation:\n - ``measured_infiltration_rate_m_per_s``: from a BRE 365\n falling-head soakage test on site\n - ``confidence``: per C753 Table 25.4 — LOW (single test, FoS=10),\n MEDIUM (2-3 tests, FoS=4), HIGH (≥3 tests + groundwater\n monitoring, FoS=2)\n - ``hot_spot``: per C753 §25.5 — LOW (residential / amenity),\n MEDIUM (car parks, minor roads), HIGH (A-roads, large car\n parks), VERY_HIGH (forecourts, lorry parks — not permitted\n without pre-treatment)\n\nGeometry:\n Rectangular plan, prismatic depth. The depth here is the\n effective storage depth (water level at design fill); the\n attenuation_tank's ``cover_to_tank_top`` covers the soil cover\n above the granular surround.\n\nThe granular fill type is governed by the underlying\nattenuation_tank delegate — pick ``tank_type=CRATE`` for modular\ngeocellular soakaways (typical for high storage / low footprint)\nor ``tank_type=PIPES`` for large-bore concrete pipe soakaways\n(typical for highway and industrial). The ``void_ratio`` here\napplies to the granular-fill case (TankType.CRATE with\n``crate_void_ratio`` becomes a free user choice; for the pipe\ncase the pipes themselves provide the storage volume)."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Stormwater attenuation tank supporting two configurations: modular geocellular crates (high void ratio, compact footprint) or large-bore pipe arrays (1.5m+ ID concrete pipes in parallel runs). Excavation may be open-battered or vertical-sided with sheet pile support. Example params: tank_length=30 m (2–200), crate_width=6 m (1–20), crate_height=1.2 m (0.4–3.6). Example call: {"params": {"tank_length": 30, "crate_width": 6, "crate_height": 1.2}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_attenuation_tank",
"title": "Compute Stormwater Attenuation Tank BoQ",
"description": "Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. Stormwater attenuation tank supporting two configurations: modular geocellular crates (high void ratio, compact footprint) or large-bore pipe arrays (1.5m+ ID concrete pipes in parallel runs). Excavation may be open-battered or vertical-sided with sheet pile support. Example params: tank_length=30 m (2–200), crate_width=6 m (1–20), crate_height=1.2 m (0.4–3.6). Example call: {\"params\": {\"tank_length\": 30, \"crate_width\": 6, \"crate_height\": 1.2}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"tank_type": {
"enum": [
"crate",
"pipes"
],
"type": "string",
"default": "crate"
},
"pipe_count": {
"type": "integer",
"default": 3
},
"crate_width": {
"type": "number",
"default": 6
},
"tank_length": {
"type": "number",
"default": 30
},
"crate_height": {
"type": "number",
"default": 1.2
},
"pipe_diameter": {
"type": "number",
"default": 1.5
},
"crate_void_ratio": {
"type": "number",
"default": 0.95
},
"bedding_thickness": {
"type": "number",
"default": 0.15
},
"cover_to_tank_top": {
"type": "number",
"default": 0.8
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"surround_material": {
"type": "string",
"default": "20mm single-size aggregate"
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter"
},
"pipe_clear_spacing": {
"type": "number",
"default": 0.4
},
"pipe_wall_thickness": {
"type": "number",
"default": 0.11
},
"cover_material_class": {
"type": "string",
"default": "Class 6N"
},
"geotextile_full_wrap": {
"type": "boolean",
"default": true
},
"working_space_each_side": {
"type": "number",
"default": 0.6
},
"formation_prep_thickness": {
"type": "number",
"default": 0.15
},
"granular_surround_thickness": {
"type": "number",
"default": 0.3
},
"sheet_pile_depth_below_formation": {
"type": "number",
"default": 1.5
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_attenuation_tank. Vegetated, geotextile-reinforced or rip-rap-lined linear drainage swale per CIRIA C753. Trapezoidal prismatic channel with three lining strategies covering the UK design palette from low-velocity amenity grass channels (1V:3H, 1-3% gradient) to high-velocity rip-rap-lined stretches. Optional check-dams (stone or concrete) for steeper sections. Renders cleanly across all four standards using existing earthworks / geosynthetics / concrete handlers — no PC items, all contractor-full supply route. Example params: bed_width=0.5 m (0.2–3), left_side_slope_h_per_v=3 (1.5–6), right_side_slope_h_per_v=3 (1.5–6). Example call: {"params": {"bed_width": 0.5, "left_side_slope_h_per_v": 3, "right_side_slope_h_per_v": 3}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_swale",
"title": "Compute SuDS Swale (CIRIA C753) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_attenuation_tank. Vegetated, geotextile-reinforced or rip-rap-lined linear drainage swale per CIRIA C753. Trapezoidal prismatic channel with three lining strategies covering the UK design palette from low-velocity amenity grass channels (1V:3H, 1-3% gradient) to high-velocity rip-rap-lined stretches. Optional check-dams (stone or concrete) for steeper sections. Renders cleanly across all four standards using existing earthworks / geosynthetics / concrete handlers — no PC items, all contractor-full supply route. Example params: bed_width=0.5 m (0.2–3), left_side_slope_h_per_v=3 (1.5–6), right_side_slope_h_per_v=3 (1.5–6). Example call: {\"params\": {\"bed_width\": 0.5, \"left_side_slope_h_per_v\": 3, \"right_side_slope_h_per_v\": 3}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"lining": {
"enum": [
"vegetated",
"geotextile_reinforced",
"rip_rap"
],
"type": "string",
"default": "vegetated",
"description": "Swale lining type — drives which WorkItems are emitted."
},
"bed_width": {
"type": "number",
"default": 0.5
},
"trm_grade": {
"type": "string",
"default": "300 g/m² turf reinforcement mat (SHW Cl. 624)"
},
"swale_depth": {
"type": "number",
"default": 0.4
},
"rip_rap_spec": {
"type": "string",
"default": "200-300mm rip-rap rock fill (SHW Cl. 622, Class 6F2)"
},
"swale_length": {
"type": "number",
"default": 50
},
"check_dam_count": {
"type": "integer",
"default": 0
},
"grass_seed_spec": {
"type": "string",
"default": "amenity grass seed mix, BS 7370-3"
},
"rip_rap_thickness": {
"type": "number",
"default": 0.25
},
"check_dam_material": {
"enum": [
"stone",
"concrete"
],
"type": "string",
"default": "stone",
"description": "Material for optional check-dams."
},
"check_dam_thickness": {
"type": "number",
"default": 0.3
},
"topsoil_place_depth": {
"type": "number",
"default": 0.15
},
"topsoil_strip_depth": {
"type": "number",
"default": 0.25
},
"longitudinal_gradient": {
"type": "number",
"default": 0.02
},
"formation_prep_required": {
"type": "boolean",
"default": true
},
"left_side_slope_h_per_v": {
"type": "number",
"default": 3
},
"right_side_slope_h_per_v": {
"type": "number",
"default": 3
},
"rip_rap_geotextile_grade": {
"type": "string",
"default": "200 g/m² non-woven filter (SHW Cl. 624)"
},
"topsoil_strip_envelope_offset": {
"type": "number",
"default": 0.5
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Prefabricated petrol/oil interceptor (separator) per BS EN 858-1:2002 / BS EN 858-2:2003 and SHW Cl. 519. Catalogue-driven on three axes: Class (1 with coalescer + auto-closure for ≤5 mg/l surface-water discharge, or 2 for ≤100 mg/l foul-sewer discharge), Type (full retention NSF for high-spill-risk forecourts, or bypass NSB for low-spill-risk car parks), and Nominal Size (NS3 to NS100 l/s flow rating — 7 catalogue entries). Composite of the procured interceptor unit (Nr, default supply route CONTRACTOR_INSTALL_PC_SUPPLY for engineer-specified prefab), concrete blinding bedding, granular surround per SHW Cl. 803, geotextile separator, and foundation excavation with optional sheet pile support. Oil storage capacity derived per BS EN 858-2 cl. 4.3.6 (V = NS×10 for full retention, NSB×15 for bypass). Opens drainage_treatment leaf; the canonical pre-treatment for hot-spot catchments draining to soakaway, watercourse, or foul sewer. Routes via CESMM4 K.5.x.n (size-banded), NRM2 33.9.x, MMHW 500.13.x (SHW Cl. 519), SMM7 R12.5.x. Example params: bedding_blinding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.3 m (0.15–0.5), surround_thickness_each_side_m=0.3 m (0.15–0.5). Example call: {"params": {"bedding_blinding_thickness_mm": 150, "bedding_overhang_m": 0.3, "surround_thickness_each_side_m": 0.3}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a petrol/oil interceptor installation. Catalogue-driven on three axes: size (NS rating, catalogue lookup for dimensions/mass/silt), class (performance — CLASS_1/CLASS_2), and type (full retention vs bypass). |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_petrol_oil_interceptor",
"title": "Compute Prefabricated Petrol/Oil Interceptor (Separator) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_manhole. Prefabricated petrol/oil interceptor (separator) per BS EN 858-1:2002 / BS EN 858-2:2003 and SHW Cl. 519. Catalogue-driven on three axes: Class (1 with coalescer + auto-closure for ≤5 mg/l surface-water discharge, or 2 for ≤100 mg/l foul-sewer discharge), Type (full retention NSF for high-spill-risk forecourts, or bypass NSB for low-spill-risk car parks), and Nominal Size (NS3 to NS100 l/s flow rating — 7 catalogue entries). Composite of the procured interceptor unit (Nr, default supply route CONTRACTOR_INSTALL_PC_SUPPLY for engineer-specified prefab), concrete blinding bedding, granular surround per SHW Cl. 803, geotextile separator, and foundation excavation with optional sheet pile support. Oil storage capacity derived per BS EN 858-2 cl. 4.3.6 (V = NS×10 for full retention, NSB×15 for bypass). Opens drainage_treatment leaf; the canonical pre-treatment for hot-spot catchments draining to soakaway, watercourse, or foul sewer. Routes via CESMM4 K.5.x.n (size-banded), NRM2 33.9.x, MMHW 500.13.x (SHW Cl. 519), SMM7 R12.5.x. Example params: bedding_blinding_thickness_mm=150 mm (100–300), bedding_overhang_m=0.3 m (0.15–0.5), surround_thickness_each_side_m=0.3 m (0.15–0.5). Example call: {\"params\": {\"bedding_blinding_thickness_mm\": 150, \"bedding_overhang_m\": 0.3, \"surround_thickness_each_side_m\": 0.3}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"size": {
"enum": [
"NS3",
"NS6",
"NS10",
"NS15",
"NS30",
"NS65",
"NS100"
],
"type": "string",
"default": "NS10",
"description": "Nominal size NS designation per BS EN 858-2. The number is the\nnominal flow rating in l/s; the catalogue dimensions are sized to\nsuit the full-retention storage volume V_oil = NS × 10 litres\n(cl. 4.3.6). Bypass units of the same NS rating share dimensions\nin most UK manufacturer ranges (the bypass weir is internal).\n\nSeven catalogue entries spanning the practical UK range:\n NS3 — small private yard, ~600m² impermeable catchment\n NS6 — modest commercial / garage forecourt, ~1,200m²\n NS10 — typical commercial yard / small forecourt, ~2,000m²\n NS15 — larger commercial site, ~3,000m²\n NS30 — large car park / petrol forecourt, ~6,000m²\n NS65 — major forecourt / small depot, ~13,000m²\n NS100 — industrial / lorry park / motorway service area, ~20,000m²\n\n(NS rating ↔ catchment area mapping is approximate; BS EN 858-2\ncl. 4.3.4 gives the formula NS = A × i × f, where i is the design\nrainfall intensity and f is the fluid-density factor.)"
},
"width_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"height_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"length_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "integer",
"default": 1
},
"project_ref": {
"type": "string",
"default": ""
},
"unit_mass_t": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"ns_rating_ls": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"supply_route": {
"enum": [
"contractor_full",
"contractor_install_pc_supply",
"provisional_sum",
"utility_provider_supply",
"employer_direct"
],
"type": "string",
"default": "contractor_install_pc_supply"
},
"oil_storage_l": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"chainage_label": {
"type": "string",
"default": ""
},
"surround_class": {
"type": "string",
"default": "6N"
},
"invert_to_top_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"silt_capacity_l": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"interceptor_type": {
"enum": [
"full_retention",
"bypass"
],
"type": "string",
"default": "full_retention",
"description": "Separator type per BS EN 858-2 cl. 4.3:\n\n FULL_RETENTION (NS / NSF designation): treats the full design flow\n from the contributing impermeable catchment. Sized to retain the\n full contents of one compartment of a road tanker (≥ 7,600 litres\n per cl. 4.3.6 for forecourt applications). Used at petrol filling\n stations, fuel depots, and any high-spill-risk site.\n\n BYPASS (NSB designation): treats only the first-flush of run-off\n (typically up to 6.5 mm/h equivalent rainfall, ~10% of design\n peak). Above that rate, excess flow bypasses the separator via\n an internal weir. Used at large car parks where the spill risk\n is low and bypass of large storm flows is acceptable. Oil\n storage volume V = NSB × 15 (cl. 4.3.6) — 50% more storage per\n nominal-size unit than full-retention."
},
"cover_to_invert_m": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"excavation_batter": {
"type": "number",
"default": 0.5
},
"performance_class": {
"enum": [
"class_1",
"class_2"
],
"type": "string",
"default": "class_1",
"description": "Performance class per BS EN 858-1 cl. 5.4 / 5.5. Tested oil-in-water\nconcentration at outflow under standard test conditions:\n\n CLASS_1: ≤ 5 mg/l. Includes a coalescing filter and an automatic\n closure device (auto-shut valve triggered when oil layer\n reaches design depth). Required for discharge to:\n - surface water sewer\n - watercourse (river / stream)\n - soakaway (with engineer agreement)\n - any controlled water body\n CLASS_2: ≤ 100 mg/l. Gravity separation only (no coalescer). Used\n for discharge to a foul sewer or to upstream of a Class 1\n unit (rare two-stage configuration)."
},
"bedding_overhang_m": {
"type": "number",
"default": 0.3
},
"excavation_support": {
"enum": [
"open_batter",
"vertical_supported"
],
"type": "string",
"default": "open_batter",
"description": "Excavation support method. OPEN_BATTER assumes stable ground and\nenough working area for battered sides (typically 1V:1H or steeper);\nVERTICAL_SUPPORTED requires sheet piling, trench boxes, or shoring\nand emits an EXCAVATION_SUPPORT (m²) line."
},
"catalogue_size_label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"bedding_blinding_grade": {
"type": "string",
"default": "C8/10"
},
"cover_to_top_of_unit_m": {
"type": "number",
"default": 0.3
},
"has_separate_silt_chamber": {
"type": "boolean",
"default": false
},
"working_space_each_side_m": {
"type": "number",
"default": 0.5
},
"geotextile_separator_grade": {
"type": "string",
"default": "200 g/m²"
},
"bedding_blinding_thickness_mm": {
"type": "integer",
"default": 150
},
"surround_thickness_each_side_m": {
"type": "number",
"default": 0.3
},
"sheet_pile_depth_below_invert_m": {
"type": "number",
"default": 1
}
},
"description": "Parameter form for a petrol/oil interceptor installation.\n\nCatalogue-driven on three axes: size (NS rating, catalogue lookup\nfor dimensions/mass/silt), class (performance — CLASS_1/CLASS_2),\nand type (full retention vs bypass)."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Modular gabion retaining wall built from welded or hexagonal-mesh wire baskets filled with hard angular graded stone (SHW Cl. 622). The first non-concrete retaining structure in the platform and the FIRST member of the earth_structures L1 leaf — opening Phase E. Spans four structural forms via the gabion_form discriminator: STACKED_RECTANGULAR (standard highway boundary), STACKED_STEPPED (architectural / heritage), BATTERED (tall walls with back batter), and FACING_MATTRESS (Reno-type mattresses for slope facing / scour protection). Eight variant presets exercise the parameter form covering all four gabion_form values: highway boundary, landscape, stepped front, heritage stepped, battered, river training, scour apron, and tall battered. Routes via three new WorkCategory entries (GABION_BASKET, GABION_FACING_MATTRESS, STONE_FILL) — the first session where the classed-then-legacy discriminator pattern is applied to fundamentally new measurement vocabulary rather than to existing concrete categories. Codes: CESMM4 E.8.1-3 (Class E — Earthworks), NRM2 5.20-22 (Group 5 — Excavating and filling), MMHW 600.12-14 (Series 600 — Earthworks; SHW Cl. 622/623), and SMM7 D41.1/D41.2/D20.20 (D41 — Crib walls / gabions / reinforced earth — the only standard with a NAMED home). 16th use of the discriminator pattern, first applied to new WorkCategories rather than legacy ones. Example params: wall_height=3 m (0.1–8), wall_length=25 m (5–200), basket_length_m=2 m (1–3). Example call: {"params": {"wall_height": 3, "wall_length": 25, "basket_length_m": 2}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a gabion retaining wall. A single dataclass that — through combinations of its fields and the ``gabion_form`` discriminator — produces all eight VARIANT_PRESETS plus arbitrary user-specified geometries across all four GabionForm options. Sensible defaults yield a 3m highway-bound… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_gabion_wall",
"title": "Compute Gabion Retaining Wall BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Modular gabion retaining wall built from welded or hexagonal-mesh wire baskets filled with hard angular graded stone (SHW Cl. 622). The first non-concrete retaining structure in the platform and the FIRST member of the earth_structures L1 leaf — opening Phase E. Spans four structural forms via the gabion_form discriminator: STACKED_RECTANGULAR (standard highway boundary), STACKED_STEPPED (architectural / heritage), BATTERED (tall walls with back batter), and FACING_MATTRESS (Reno-type mattresses for slope facing / scour protection). Eight variant presets exercise the parameter form covering all four gabion_form values: highway boundary, landscape, stepped front, heritage stepped, battered, river training, scour apron, and tall battered. Routes via three new WorkCategory entries (GABION_BASKET, GABION_FACING_MATTRESS, STONE_FILL) — the first session where the classed-then-legacy discriminator pattern is applied to fundamentally new measurement vocabulary rather than to existing concrete categories. Codes: CESMM4 E.8.1-3 (Class E — Earthworks), NRM2 5.20-22 (Group 5 — Excavating and filling), MMHW 600.12-14 (Series 600 — Earthworks; SHW Cl. 622/623), and SMM7 D41.1/D41.2/D20.20 (D41 — Crib walls / gabions / reinforced earth — the only standard with a NAMED home). 16th use of the discriminator pattern, first applied to new WorkCategories rather than legacy ones. Example params: wall_height=3 m (0.1–8), wall_length=25 m (5–200), basket_length_m=2 m (1–3). Example call: {\"params\": {\"wall_height\": 3, \"wall_length\": 25, \"basket_length_m\": 2}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"quantity": {
"type": "integer",
"default": 1
},
"mesh_grade": {
"enum": [
"galvanised_hexagonal",
"pvc_coated_galfan",
"galvanised_welded"
],
"type": "string",
"default": "galvanised_hexagonal",
"description": "Wire mesh grade per BS EN 10223-3 (woven) or BS EN 10218-2\n(welded).\n\nGALVANISED_HEXAGONAL — Heavily galvanised double-twisted hexagonal\n woven wire mesh. Standard for non-aggressive\n environments. Wire diameter 2.7mm typical.\n Lifespan 30-60 years depending on environment.\nPVC_COATED_GALFAN — Galfan (Zn-Al alloy) coated wire with\n polymer (PVC or PA6) outer coating. For\n aggressive environments (saline coastal,\n contaminated land, brackish water). Lifespan\n 60-120 years. Standard for permanent\n highway works on coastal alignments.\nGALVANISED_WELDED — Welded rectangular wire mesh; stiffer\n baskets, sharper edges, less flexible.\n Sometimes preferred for architectural\n contexts where straight edges matter."
},
"gabion_form": {
"enum": [
"stacked_rectangular",
"stacked_stepped",
"battered",
"facing_mattress"
],
"type": "string",
"default": "stacked_rectangular",
"description": "Structural form of the gabion retaining wall.\n\nSTACKED_RECTANGULAR — Straight-faced stacked baskets; the most\n common practical form. Both front and back\n faces vertical. Each course is the same\n horizontal dimension. Typical for highway\n boundary walls 2-3m tall, garden/landscape\n walls, and small revetment walls.\n\nSTACKED_STEPPED — Front-face stepped. Each successive course\n (from bottom up) is offset back from the\n one below. Used for architectural / heritage\n contexts where the visible face needs visual\n interest, and for taller walls where stability\n is improved by stepping the cg backwards.\n Step offset typically 0.25-0.50m per course.\n\nBATTERED — Back-battered profile (front face vertical,\n back face battered inwards). Used for taller\n walls (4-6m+) where the increased base width\n per unit height improves overturning\n stability. Batter angle typically 6-15° from\n vertical (1:10 to 1:4 H:V).\n\nFACING_MATTRESS — Thin (typically 150-300mm) face-mounted gabion\n mattresses (Reno-type) applied to a backing\n fill or natural slope. Used for slope facing,\n river-bank revetment, scour protection\n aprons. Routes the primary measurement line\n to GABION_FACING_MATTRESS (m²) rather than\n GABION_BASKET (m³). Includes both inclined\n slope-face mattresses and horizontal scour\n aprons."
},
"wall_height": {
"type": "number",
"default": 3
},
"wall_length": {
"type": "number",
"default": 25
},
"course_count": {
"type": "integer",
"default": 3
},
"backfill_class": {
"type": "string",
"default": "Class 6N"
},
"basket_width_m": {
"type": "number",
"default": 1
},
"blinding_grade": {
"type": "string",
"default": "C8/10"
},
"basket_height_m": {
"type": "number",
"default": 1
},
"basket_length_m": {
"type": "number",
"default": 2
},
"retained_height": {
"type": "number",
"default": 2.7
},
"backfill_width_m": {
"type": "number",
"default": 0.5
},
"batter_angle_deg": {
"type": "number",
"default": 8
},
"geotextile_grade": {
"type": "string",
"default": "200 g/m²"
},
"include_blinding": {
"type": "boolean",
"default": true
},
"stone_fill_grade": {
"enum": [
"hard_angular_60_150",
"hard_angular_100_200",
"hard_angular_150_300",
"dressed_sandstone"
],
"type": "string",
"default": "hard_angular_100_200",
"description": "Stone fill specification per SHW Cl. 622 (gabions) or Cl. 623\n(rockfill).\n\nHARD_ANGULAR_60_150 — 60-150mm grade. Used for mattresses (thinner\n sections need smaller stone to fill properly)\n and small landscape walls.\nHARD_ANGULAR_100_200 — 100-200mm grade. The most common UK highway\n specification for standard 1m-cube gabion\n baskets.\nHARD_ANGULAR_150_300 — 150-300mm grade. Used for larger baskets\n (1.5m or 2m courses) and where larger stone\n is locally available economically.\nDRESSED_SANDSTONE — Hand-dressed natural stone (typically\n sandstone or local stone matching heritage\n context). Architectural premium product."
},
"excavation_batter": {
"type": "number",
"default": 1
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter",
"description": "Excavation support strategy for below-ground assemblies.\n\nConsumed by retaining walls (cantilever, gravity, counterfort,\nanchored, bored pile), foundation assemblies, and drainage chambers\nthat involve a battered or vertical-supported pit. The enum value is\nsurfaced in the description text of the relevant excavation BoQ line\nand in some standards (CESMM4 E.4.4 et seq.) drives a separate code."
},
"foundation_profile": {
"enum": [
"level",
"stepped"
],
"type": "string",
"default": "level",
"description": "Foundation formation profile — level or stepped.\n\nConsumed by retaining walls and foundation assemblies built on\nsloping ground. STEPPED foundation reuses the v10 cross-cutting\nEXCAVATION_FOUNDATION stepping discrimination upgrade (originally\nadded for strip_foundation S8). The stepping branch in the standards\nhandlers detects ``is_stepped=True`` on EXCAVATION_FOUNDATION items\nand routes to the stepped-foundation codes."
},
"include_geotextile": {
"type": "boolean",
"default": true
},
"blinding_thickness_m": {
"type": "number",
"default": 0.1
},
"mattress_thickness_mm": {
"type": "integer",
"default": 300
},
"mattress_apron_width_m": {
"type": "number",
"default": 4
},
"excavation_working_space": {
"type": "number",
"default": 0.3
},
"mattress_slope_angle_deg": {
"type": "number",
"default": 33.7
},
"step_offset_per_course_m": {
"type": "number",
"default": 0.3
}
},
"description": "Parameter form for a gabion retaining wall.\n\nA single dataclass that — through combinations of its fields and\nthe ``gabion_form`` discriminator — produces all eight\nVARIANT_PRESETS plus arbitrary user-specified geometries across\nall four GabionForm options. Sensible defaults yield a 3m\nhighway-boundary STACKED_RECTANGULAR wall with 1m × 1m × 2m\ngalvanised hexagonal baskets filled with 100-200mm graded stone."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Reinforced soil retaining wall (RSW) using granular fill reinforced with horizontal layers of geogrid or steel tie strips, with one of four facing systems: precast concrete panels (Reinforced Earth™ / VSL Retained Earth style), segmental modular blocks (Allan Block / Keystone), wraparound soft face (vegetated or biodegradable mat), or Terramesh-style steel mesh face (re-using the S29 gabion vocabulary). The SECOND member of the earth_structures L1 leaf (after gabion_wall at S29), the SIXTH member of the wall family, the FIFTH structural system, and the FIRST wall family member with a face-area-primary measurement basis (m² of face + m² × layers of geogrid, both m²; every prior wall body was m³). 17th use of the classed-then-legacy attribute discrimination pattern. Routes via four new WorkCategory entries (RSW_FACING_PANEL, RSW_MODULAR_BLOCK, RSW_WRAPAROUND_FACE, RSW_TIE_STRIP) plus the GEOGRID category (whose handler is gap-filled in CESMM4/NRM2/MMHW this session) plus re-use of GABION_BASKET on the STEEL_MESH_FACE variant. Codes: CESMM4 E.8.4-8 (Class E Earthworks §E.8 stabilisation), NRM2 5.23-27 (Group 5 Excavating and filling), MMHW 600.15-19 (Series 600 Earthworks; SHW Cl. 624 reinforced earth retaining structures), and SMM7 D41.3/D41.4/D41.5/D20.21/D20.14.2 (D41 — Crib walls / gabions / REINFORCED EARTH — the NAMED home, now serving TWO wall families). Eight variant presets exercise all four RSWFacing values (2/2/2/2 split). Example params: wall_height=6 m (0.5–12), wall_length=40 m (5–200), depth_into_fill_m=4.5 m (0.35–15). Example call: {"params": {"wall_height": 6, "wall_length": 40, "depth_into_fill_m": 4.5}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameter form for a reinforced soil wall. A single dataclass that — through combinations of its fields and the ``rsw_facing`` discriminator — produces all eight VARIANT_PRESETS plus arbitrary user-specified geometries across all four RSWFacing options. Sensible defaults yield a 6m highway-approach… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_reinforced_soil_wall",
"title": "Compute Reinforced Soil Wall (RSW) BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Reinforced soil retaining wall (RSW) using granular fill reinforced with horizontal layers of geogrid or steel tie strips, with one of four facing systems: precast concrete panels (Reinforced Earth™ / VSL Retained Earth style), segmental modular blocks (Allan Block / Keystone), wraparound soft face (vegetated or biodegradable mat), or Terramesh-style steel mesh face (re-using the S29 gabion vocabulary). The SECOND member of the earth_structures L1 leaf (after gabion_wall at S29), the SIXTH member of the wall family, the FIFTH structural system, and the FIRST wall family member with a face-area-primary measurement basis (m² of face + m² × layers of geogrid, both m²; every prior wall body was m³). 17th use of the classed-then-legacy attribute discrimination pattern. Routes via four new WorkCategory entries (RSW_FACING_PANEL, RSW_MODULAR_BLOCK, RSW_WRAPAROUND_FACE, RSW_TIE_STRIP) plus the GEOGRID category (whose handler is gap-filled in CESMM4/NRM2/MMHW this session) plus re-use of GABION_BASKET on the STEEL_MESH_FACE variant. Codes: CESMM4 E.8.4-8 (Class E Earthworks §E.8 stabilisation), NRM2 5.23-27 (Group 5 Excavating and filling), MMHW 600.15-19 (Series 600 Earthworks; SHW Cl. 624 reinforced earth retaining structures), and SMM7 D41.3/D41.4/D41.5/D20.21/D20.14.2 (D41 — Crib walls / gabions / REINFORCED EARTH — the NAMED home, now serving TWO wall families). Eight variant presets exercise all four RSWFacing values (2/2/2/2 split). Example params: wall_height=6 m (0.5–12), wall_length=40 m (5–200), depth_into_fill_m=4.5 m (0.35–15). Example call: {\"params\": {\"wall_height\": 6, \"wall_length\": 40, \"depth_into_fill_m\": 4.5}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"quantity": {
"type": "integer",
"default": 1
},
"fill_class": {
"type": "string",
"default": "Class 6I"
},
"rsw_facing": {
"enum": [
"precast_panel",
"modular_block",
"wraparound",
"steel_mesh_face"
],
"type": "string",
"default": "precast_panel",
"description": "Facing system of the reinforced soil wall.\n\nPRECAST_PANEL — Reinforced Earth™ / Freyssinet / VSL Retained Earth\n style precast concrete facing panels (T-shape or\n cruciform). Primary measurement: face area m²\n routes to RSW_FACING_PANEL. Steel tie strips\n route separately to RSW_TIE_STRIP. Geogrid\n reinforcement (where used in addition to or in\n place of tie strips) routes to GEOGRID. Typical\n highway use: motorway widening, bridge approach\n embankments, mainline-network junction\n improvements.\n\nMODULAR_BLOCK — Segmental concrete block facing (Allan Block /\n Keystone / Anchor / Versa-Lok). Primary\n measurement: face area m² routes to\n RSW_MODULAR_BLOCK. Geogrid layers clamped between\n courses route to GEOGRID. Typical use: retail\n park boundary walls, golf-course retaining walls,\n cycle bridge approaches, residential development\n grading.\n\nWRAPAROUND — Soft-faced wraparound system: geogrid wraps the\n face of each lift and folds back into the\n reinforced fill. Primary measurement: face area\n m² routes to RSW_WRAPAROUND_FACE (the extra\n wraparound geogrid is built into the rate);\n horizontal reinforcement layers route to\n GEOGRID. Typical use: embankment toe\n stabilisation, slope-repair works, vegetated\n landscape retaining structures, temporary\n haul-road retaining walls.\n\nSTEEL_MESH_FACE — Welded steel mesh \"gabion-style\" face with\n geogrid extending into the reinforced fill\n behind (Maccaferri Terramesh / Tensar Terramesh\n system). The face is structurally a gabion at\n the face line but the bulk of the structure is\n reinforced soil. Primary measurement: face is\n a thin gabion-style basket and routes to\n GABION_BASKET (re-using the S29 vocabulary —\n every RSW STEEL_MESH_FACE variant has zero new\n face WorkCategory introduction). Geogrid\n reinforcement layers extending into the fill\n route to GEOGRID. Typical use: highway boundary\n walls where the gabion aesthetic is wanted but\n the wall is too tall for a gravity gabion\n structure."
},
"layer_count": {
"type": "integer",
"default": 8
},
"wall_height": {
"type": "number",
"default": 6
},
"wall_length": {
"type": "number",
"default": 40
},
"block_pattern": {
"enum": [
"allan_block",
"keystone",
"anchor_vertica",
"versa_lok"
],
"type": "string",
"default": "allan_block",
"description": "Block pattern for MODULAR_BLOCK variant."
},
"geogrid_grade": {
"enum": [
"biaxial_pp",
"uniaxial_hdpe",
"uniaxial_polyester",
"galfan_steel_strip"
],
"type": "string",
"default": "uniaxial_polyester",
"description": "Geogrid product grade per BS EN 13251 / BS 8006-1:2010.\n\nThe grade governs the long-term design strength T_d (kN/m), which\ndrives the layer length and the layer count required for stability."
},
"blinding_grade": {
"type": "string",
"default": "C8/10"
},
"face_treatment": {
"enum": [
"vegetated",
"biodegradable_erosion_mat",
"sprayed_hydroseed"
],
"type": "string",
"default": "vegetated",
"description": "Surface treatment for WRAPAROUND variant."
},
"lift_height_mm": {
"type": "integer",
"default": 600
},
"block_height_mm": {
"type": "integer",
"default": 200
},
"face_panel_type": {
"enum": [
"t_shape_cruciform",
"hexagonal",
"rectangular_flat"
],
"type": "string",
"default": "t_shape_cruciform",
"description": "Facing panel pattern for PRECAST_PANEL variant."
},
"layer_spacing_m": {
"type": "number",
"default": 0.75
},
"geotextile_grade": {
"type": "string",
"default": "200 g/m²"
},
"include_blinding": {
"type": "boolean",
"default": true
},
"depth_into_fill_m": {
"type": "number",
"default": 4.5
},
"excavation_batter": {
"type": "number",
"default": 1
},
"excavation_support": {
"enum": [
"open_batter",
"vertical"
],
"type": "string",
"default": "open_batter",
"description": "Excavation support strategy for below-ground assemblies.\n\nConsumed by retaining walls (cantilever, gravity, counterfort,\nanchored, bored pile), foundation assemblies, and drainage chambers\nthat involve a battered or vertical-supported pit. The enum value is\nsurfaced in the description text of the relevant excavation BoQ line\nand in some standards (CESMM4 E.4.4 et seq.) drives a separate code."
},
"foundation_profile": {
"enum": [
"level",
"stepped"
],
"type": "string",
"default": "level",
"description": "Foundation formation profile — level or stepped.\n\nConsumed by retaining walls and foundation assemblies built on\nsloping ground. STEPPED foundation reuses the v10 cross-cutting\nEXCAVATION_FOUNDATION stepping discrimination upgrade (originally\nadded for strip_foundation S8). The stepping branch in the standards\nhandlers detects ``is_stepped=True`` on EXCAVATION_FOUNDATION items\nand routes to the stepped-foundation codes."
},
"include_geotextile": {
"type": "boolean",
"default": true
},
"include_tie_strips": {
"type": "boolean",
"default": true
},
"panel_thickness_mm": {
"type": "integer",
"default": 180
},
"tie_strip_length_m": {
"type": "number",
"default": 4.5
},
"tie_strip_width_mm": {
"type": "integer",
"default": 50
},
"blinding_thickness_m": {
"type": "number",
"default": 0.1
},
"panel_concrete_grade": {
"type": "string",
"default": "C40/50"
},
"terramesh_mesh_grade": {
"type": "string",
"default": "galvanised hexagonal (BS EN 10223-3)"
},
"terramesh_stone_size": {
"type": "string",
"default": "100-200"
},
"tie_strip_thickness_mm": {
"type": "integer",
"default": 4
},
"excavation_working_space": {
"type": "number",
"default": 0.3
},
"terramesh_basket_width_m": {
"type": "number",
"default": 0.7
},
"tie_strip_density_per_m2": {
"type": "number",
"default": 2
},
"terramesh_basket_height_m": {
"type": "number",
"default": 1
},
"terramesh_basket_length_m": {
"type": "number",
"default": 2
},
"block_setback_per_course_mm": {
"type": "integer",
"default": 15
},
"geogrid_long_term_strength_kN": {
"type": "number",
"default": 80
}
},
"description": "Parameter form for a reinforced soil wall.\n\nA single dataclass that — through combinations of its fields and\nthe ``rsw_facing`` discriminator — produces all eight\nVARIANT_PRESETS plus arbitrary user-specified geometries across\nall four RSWFacing options. Sensible defaults yield a 6m\nhighway-approach PRECAST_PANEL wall."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Cut slope stabilised by passively-stressed soil nails with an applied face system. Discriminates between four face systems via the face_system enum: SHOTCRETE_MESH (dominant UK highway-cutting choice per SHW Cl. 644), HARD_FACING_PANEL (premium permanent works), FLEXIBLE_MESH (weathered rock drape), and VEGETATED_GEOGRID (landscape-sensitive schemes). Third member of the earth_structures L1 leaf (after gabion_wall S29 and reinforced_soil_wall S30). Eight variant presets cover all four face systems × representative slope geometries. Routes via three new WorkCategory entries (SOIL_NAIL, SHOTCRETE_FACE, FACE_MESH_REINFORCEMENT) plus reuse of EXCAVATION_GENERAL, DISPOSAL, CONCRETE_REINFORCED, GEOTEXTILE_FILTER, GEOGRID, and TOPSOIL_PLACE. Codes: CESMM4 C.5.X (soil nail) + E.8.10 (shotcrete) + G.5.8 (mesh), NRM2 7.7.X + 5.28.1 + 11.6.1, MMHW 600.20.X + 600.21.1 + 600.22.1 (SHW Cl. 638-639 / Cl. 644), SMM7 D32.3.X (steel piling — soil nails) + D41.6/D41.7 (the NAMED home for the three earth-structures families now). 23rd use of the classed-then-legacy attribute discrimination pattern; 4th use of the declared-then-banded pattern (nail_length_m bands the C.5.X / 7.7.X / 600.20.X / D32.3.X third digit). Example params: slope_height_m=8 m (0.5–25), slope_angle_deg=65 ° (10–89), slope_length_m=30 m (2–500). Example call: {"params": {"slope_height_m": 8, "slope_angle_deg": 65, "slope_length_m": 30}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Parameters for a single soil-nailed slope. Geometry interpretation: - ``slope_height_m`` is the vertical extent of the cut slope (top of crest to toe of slope). - ``slope_angle_deg`` is the slope angle from horizontal (typically 50-80° for soil-nailed cuts). - ``slope_length_m`` is th… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_soil_nailed_slope",
"title": "Compute Soil-Nailed Slope BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_cantilever_wall. Cut slope stabilised by passively-stressed soil nails with an applied face system. Discriminates between four face systems via the face_system enum: SHOTCRETE_MESH (dominant UK highway-cutting choice per SHW Cl. 644), HARD_FACING_PANEL (premium permanent works), FLEXIBLE_MESH (weathered rock drape), and VEGETATED_GEOGRID (landscape-sensitive schemes). Third member of the earth_structures L1 leaf (after gabion_wall S29 and reinforced_soil_wall S30). Eight variant presets cover all four face systems × representative slope geometries. Routes via three new WorkCategory entries (SOIL_NAIL, SHOTCRETE_FACE, FACE_MESH_REINFORCEMENT) plus reuse of EXCAVATION_GENERAL, DISPOSAL, CONCRETE_REINFORCED, GEOTEXTILE_FILTER, GEOGRID, and TOPSOIL_PLACE. Codes: CESMM4 C.5.X (soil nail) + E.8.10 (shotcrete) + G.5.8 (mesh), NRM2 7.7.X + 5.28.1 + 11.6.1, MMHW 600.20.X + 600.21.1 + 600.22.1 (SHW Cl. 638-639 / Cl. 644), SMM7 D32.3.X (steel piling — soil nails) + D41.6/D41.7 (the NAMED home for the three earth-structures families now). 23rd use of the classed-then-legacy attribute discrimination pattern; 4th use of the declared-then-banded pattern (nail_length_m bands the C.5.X / 7.7.X / 600.20.X / D32.3.X third digit). Example params: slope_height_m=8 m (0.5–25), slope_angle_deg=65 ° (10–89), slope_length_m=30 m (2–500). Example call: {\"params\": {\"slope_height_m\": 8, \"slope_angle_deg\": 65, \"slope_length_m\": 30}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"quantity": {
"type": "integer",
"default": 1
},
"nail_rows": {
"type": "integer",
"default": 4
},
"face_system": {
"enum": [
"shotcrete_mesh",
"hard_facing_panel",
"flexible_mesh",
"vegetated_geogrid"
],
"type": "string",
"default": "shotcrete_mesh",
"description": "Face system for the soil-nailed slope.\n\nSHOTCRETE_MESH — Wet-mix sprayed concrete (typically C25/30 to\n C32/40) over a single layer of welded steel\n fabric mesh (BS 4483 A193 to A393), with\n horizontal reinforcing waling bars at each\n nail row. The dominant UK choice for permanent\n highway-cutting stabilisation per SHW Cl. 644.\n Routes: SHOTCRETE_FACE (m²) + FACE_MESH_\n REINFORCEMENT (m²) + SOIL_NAIL (Nr) +\n GEOTEXTILE_FILTER (m², drainage strips).\n\nHARD_FACING_PANEL — Precast concrete face panels (typically 1.5m\n × 1.5m × 0.15m thick, RC) bolted to the slope\n via the nail head plates. The premium face\n system for permanent works adjacent to\n sensitive receptors (carriageways, railways,\n bridges) where the maintained appearance of a\n hard concrete face is required and the\n durability requirement exceeds shotcrete's\n design life. Routes: CONCRETE_REINFORCED\n (m³, panels) + SOIL_NAIL (Nr) +\n GEOTEXTILE_FILTER (m²). NB: shotcrete and\n face mesh are NOT emitted — the precast\n panel IS the face.\n\nFLEXIBLE_MESH — Heavy-duty galvanised steel mesh drape (BS 4483\n A252 or similar, but typically a proprietary\n rockfall/erosion-protection drape mesh such as\n Geobrugg TECCO, Maccaferri Steelgrid HR) over\n the slope face, pinned by the nail head plates\n but NOT covered by shotcrete. The light-touch\n face system for weathered-rock cut faces where\n the dominant failure mode is surface ravelling\n rather than mass instability. Routes:\n FACE_MESH_REINFORCEMENT (m²) + SOIL_NAIL (Nr).\n No shotcrete, no drainage strips required.\n\nVEGETATED_GEOGRID — Geogrid (PP or HDPE biaxial, e.g. Tensar SS35\n or Maccaferri PSG type) wrapped over the\n slope face with topsoil and seed/turf\n established on the surface. The soft-face,\n environmentally-sensitive option — used for\n landslide stabilisation in rural / parkland\n settings, river-bank stabilisation, and\n landscape-led highway schemes. Routes:\n GEOGRID (m²) + SOIL_NAIL (Nr) + GEOTEXTILE_\n FILTER (m², drainage strips) + TOPSOIL_PLACE\n (m², face soil layer).\n\nThe four face systems span UK practice from light protection\n(FLEXIBLE_MESH) through standard (SHOTCRETE_MESH) and premium\n(HARD_FACING_PANEL) to environmentally-sensitive (VEGETATED_\nGEOGRID). These are the genuinely different commercial\ndecision points a QS would face when pricing a soil-nailed\nslope tender."
},
"steel_grade": {
"type": "string",
"default": "B500B"
},
"geogrid_grade": {
"type": "string",
"default": "PP_biaxial_35kN"
},
"nail_length_m": {
"type": "number",
"default": 6
},
"slope_height_m": {
"type": "number",
"default": 8
},
"slope_length_m": {
"type": "number",
"default": 30
},
"bar_diameter_mm": {
"type": "integer",
"default": 25
},
"nail_permanence": {
"enum": [
"permanent",
"temporary"
],
"type": "string",
"default": "permanent",
"description": "Permanent or temporary soil nail per BS EN 14490 Table 1.\n\nPERMANENT — Design life ≥ 2 years. Bar requires double corrosion\n protection (DCP): epoxy-coated bar OR galvanised bar\n + grouted cementitious annulus + corrugated plastic\n sheath. Conventional UK choice for highway-cutting\n stabilisation under SHW Cl. 644.\nTEMPORARY — Design life < 2 years. Single corrosion protection\n (SCP) acceptable — bare bar in cementitious grout\n annulus is sufficient. Used for temporary basement\n support and short-term construction-phase\n stabilisation."
},
"shotcrete_grade": {
"type": "string",
"default": "C25/30"
},
"slope_angle_deg": {
"type": "number",
"default": 65
},
"drill_diameter_mm": {
"type": "integer",
"default": 100
},
"existing_asset_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"grout_strength_mpa": {
"type": "integer",
"default": 25
},
"panel_thickness_mm": {
"type": "integer",
"default": 150
},
"nail_inclination_deg": {
"type": "number",
"default": 15
},
"panel_concrete_grade": {
"type": "string",
"default": "C32/40"
},
"topsoil_thickness_mm": {
"type": "integer",
"default": 150
},
"face_mesh_designation": {
"type": "string",
"default": "A193"
},
"shotcrete_thickness_mm": {
"type": "integer",
"default": 100
},
"drainage_strip_width_mm": {
"type": "integer",
"default": 300
},
"nail_vertical_spacing_m": {
"type": "number",
"default": 1.5
},
"drainage_strip_spacing_m": {
"type": "number",
"default": 3
},
"nail_horizontal_spacing_m": {
"type": "number",
"default": 1.5
}
},
"description": "Parameters for a single soil-nailed slope.\n\nGeometry interpretation:\n - ``slope_height_m`` is the vertical extent of the cut slope\n (top of crest to toe of slope).\n - ``slope_angle_deg`` is the slope angle from horizontal\n (typically 50-80° for soil-nailed cuts).\n - ``slope_length_m`` is the horizontal length along the slope\n crest — the spatial extent of the assembly along the highway\n alignment.\n - ``nail_rows`` is the number of horizontal rows of nails;\n ``nail_horizontal_spacing_m`` and ``nail_vertical_spacing_m``\n give the in-row and between-row centres (m).\n - ``nail_length_m`` is the design nail length (excavation +\n bond length; same for all nails in this assembly — for\n variable-length schemes, instantiate multiple assemblies).\n - ``nail_inclination_deg`` is the angle below horizontal of\n the nail axis (typically 10-20°).\n\nFace-system attributes (used only if relevant to ``face_system``):\n - ``shotcrete_thickness_mm`` / ``shotcrete_grade`` / \n ``face_mesh_designation`` — SHOTCRETE_MESH only.\n - ``panel_thickness_mm`` / ``panel_concrete_grade`` —\n HARD_FACING_PANEL only.\n - ``geogrid_grade`` / ``topsoil_thickness_mm`` —\n VEGETATED_GEOGRID only."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_end_area_earthworks. Geometry-driven embankment per MMHW Series 600 — trapezoidal cross-section with crest width, asymmetric side slopes (h:v), and per-chainage height profile. Auto-generates the CrossSection series and delegates volume integration + mass-haul + standards routing to the end_area_earthworks engine, inheriting the four-standard rendering invariant. Auto-computes topsoil strip footprint from toe-to-toe envelope and supports an optional founding-strip excavation below ground level. Example params: crest_width_m=10 m (3–30), side_slope_h_per_v=2 (1–4), strip_envelope_offset_m=0.5 m (0–2). Example call: {"params": {"crest_width_m": 10, "side_slope_h_per_v": 2, "strip_envelope_offset_m": 0.5}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).
| Parameter | Type | Description |
|---|---|---|
| params * | object | Inputs for a geometry-driven embankment cross-section assembly. The assembly generates a `CrossSection` list from the profile + geometry parameters, builds an `EndAreaEarthworksParameters` from the result + the material/method parameters carried here, and delegates compute to `EndAreaEarthworks.com… |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_embankment_cross_section",
"title": "Compute Embankment Cross-Section BoQ",
"description": "Paid tier only. Calling this without an authenticated CivilQuants account returns TIER_INSUFFICIENT — sign up at https://civilquants.com/pricing or use the free-tier alternative compute_end_area_earthworks. Geometry-driven embankment per MMHW Series 600 — trapezoidal cross-section with crest width, asymmetric side slopes (h:v), and per-chainage height profile. Auto-generates the CrossSection series and delegates volume integration + mass-haul + standards routing to the end_area_earthworks engine, inheriting the four-standard rendering invariant. Auto-computes topsoil strip footprint from toe-to-toe envelope and supports an optional founding-strip excavation below ground level. Example params: crest_width_m=10 m (3–30), side_slope_h_per_v=2 (1–4), strip_envelope_offset_m=0.5 m (0–2). Example call: {\"params\": {\"crest_width_m\": 10, \"side_slope_h_per_v\": 2, \"strip_envelope_offset_m\": 0.5}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier).",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"method": {
"enum": [
"simpsons",
"trapezoidal",
"prismoidal"
],
"type": "string",
"default": "simpsons",
"description": "Integration method preference. The actual method applied may\ndiffer — see VolumeResult.method_used."
},
"bulking": {
"anyOf": [
{
"type": "object",
"properties": {
"bulk_factor": {
"type": "number",
"default": 1.2
},
"shrink_factor": {
"type": "number",
"default": 0.9
}
},
"description": "SHW Series 600 Cl. 605 bulking/shrinkage factors.\n\nbulk_factor — multiplier applied to the in-situ cut volume to get\n the loose volume that needs haulage. Typical values:\n 1.10 for granular (Class 1x)\n 1.20 for cohesive (Class 2x)\n 1.30 for chalk (Class 3)\n 1.50 for rock (Class 8)\n Default = 1.20 (conservative average for mixed cut).\nshrink_factor — multiplier applied to the in-situ fill volume to\n get the volume of cut required to produce it.\n Typical values:\n 0.95 for granular\n 0.85 for cohesive\n 0.80 for stabilised\n Default = 0.90 (conservative average for mixed fill)."
},
{
"type": "null"
}
],
"default": null
},
"cut_class": {
"enum": [
"1A",
"1B",
"1C",
"2A",
"2B",
"2C",
"2D",
"2E",
"3",
"4",
"5A",
"5B",
"6A",
"6B",
"6C",
"6D",
"6E",
"6F1",
"6F2",
"6F3",
"6F4",
"6F5",
"6I",
"6J",
"6N",
"6P",
"6Q",
"7A",
"7B",
"7C",
"7D",
"7E",
"7F",
"8",
"9A",
"9B",
"U1A",
"U1B",
"U2"
],
"type": "string",
"default": "2C",
"description": "Full SHW Series 600 Table 6/1 acceptable material class set, plus the\nTable 6/2 unacceptable classes.\n\nThe enum value is the SHW designator. Use `family` and `default_use`\nproperties for routing in the assembly and renderer code."
},
"fill_class": {
"enum": [
"1A",
"1B",
"1C",
"2A",
"2B",
"2C",
"2D",
"2E",
"3",
"4",
"5A",
"5B",
"6A",
"6B",
"6C",
"6D",
"6E",
"6F1",
"6F2",
"6F3",
"6F4",
"6F5",
"6I",
"6J",
"6N",
"6P",
"6Q",
"7A",
"7B",
"7C",
"7D",
"7E",
"7F",
"8",
"9A",
"9B",
"U1A",
"U1B",
"U2"
],
"type": "string",
"default": "1A",
"description": "Full SHW Series 600 Table 6/1 acceptable material class set, plus the\nTable 6/2 unacceptable classes.\n\nThe enum value is the SHW designator. Use `family` and `default_use`\nproperties for routing in the assembly and renderer code."
},
"reach_name": {
"type": "string",
"default": "Embankment Ch 0+000 to Ch 0+200"
},
"capping_class": {
"enum": [
"1A",
"1B",
"1C",
"2A",
"2B",
"2C",
"2D",
"2E",
"3",
"4",
"5A",
"5B",
"6A",
"6B",
"6C",
"6D",
"6E",
"6F1",
"6F2",
"6F3",
"6F4",
"6F5",
"6I",
"6J",
"6N",
"6P",
"6Q",
"7A",
"7B",
"7C",
"7D",
"7E",
"7F",
"8",
"9A",
"9B",
"U1A",
"U1B",
"U2"
],
"type": "string",
"default": "6F2",
"description": "Full SHW Series 600 Table 6/1 acceptable material class set, plus the\nTable 6/2 unacceptable classes.\n\nThe enum value is the SHW designator. Use `family` and `default_use`\nproperties for routing in the assembly and renderer code."
},
"crest_width_m": {
"type": "number",
"default": 10
},
"height_profile": {
"type": "array",
"items": {
"type": "object",
"required": [
"chainage",
"height_m"
],
"properties": {
"chainage": {
"type": "number"
},
"height_m": {
"type": "number"
}
},
"description": "A single point on the embankment height profile.\n\n`height_m` is the embankment height above the existing ground at this\nchainage. Zero means the embankment has zero height (the alignment\nhas reached existing ground level — the embankment toe)."
}
},
"sub_base_class": {
"enum": [
"1A",
"1B",
"1C",
"2A",
"2B",
"2C",
"2D",
"2E",
"3",
"4",
"5A",
"5B",
"6A",
"6B",
"6C",
"6D",
"6E",
"6F1",
"6F2",
"6F3",
"6F4",
"6F5",
"6I",
"6J",
"6N",
"6P",
"6Q",
"7A",
"7B",
"7C",
"7D",
"7E",
"7F",
"8",
"9A",
"9B",
"U1A",
"U1B",
"U2"
],
"type": "string",
"default": "1A",
"description": "Full SHW Series 600 Table 6/1 acceptable material class set, plus the\nTable 6/2 unacceptable classes.\n\nThe enum value is the SHW designator. Use `family` and `default_use`\nproperties for routing in the assembly and renderer code."
},
"topsoil_source": {
"type": "string",
"default": "site-won"
},
"topsoil_replace": {
"type": "boolean",
"default": true
},
"left_slope_h_per_v": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"side_slope_h_per_v": {
"type": "number",
"default": 2
},
"right_slope_h_per_v": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"method_statement_ref": {
"type": "string",
"default": ""
},
"selected_import_class": {
"enum": [
"1A",
"1B",
"1C",
"2A",
"2B",
"2C",
"2D",
"2E",
"3",
"4",
"5A",
"5B",
"6A",
"6B",
"6C",
"6D",
"6E",
"6F1",
"6F2",
"6F3",
"6F4",
"6F5",
"6I",
"6J",
"6N",
"6P",
"6Q",
"7A",
"7B",
"7C",
"7D",
"7E",
"7F",
"8",
"9A",
"9B",
"U1A",
"U1B",
"U2"
],
"type": "string",
"default": "1A",
"description": "Full SHW Series 600 Table 6/1 acceptable material class set, plus the\nTable 6/2 unacceptable classes.\n\nThe enum value is the SHW designator. Use `family` and `default_use`\nproperties for routing in the assembly and renderer code."
},
"topsoil_strip_depth_m": {
"type": "number",
"default": 0.15
},
"strip_envelope_offset_m": {
"type": "number",
"default": 0.5
},
"unacceptable_proportion": {
"type": "number",
"default": 0
},
"topsoil_replace_depth_mm": {
"type": "integer",
"default": 150
},
"founding_depth_below_ground_m": {
"type": "number",
"default": 0
}
},
"description": "Inputs for a geometry-driven embankment cross-section assembly.\n\nThe assembly generates a `CrossSection` list from the profile +\ngeometry parameters, builds an `EndAreaEarthworksParameters` from\nthe result + the material/method parameters carried here, and\ndelegates compute to `EndAreaEarthworks.compute(...)`.\n\nPer Session 12 Q2 decision: left and right slopes are exposed\nseparately, both defaulting to `side_slope_h_per_v` so the common\nsymmetric case is a single-parameter call."
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. In-situ reinforced concrete cantilever retaining wall with toe, heel, and stem. Includes excavation, blinding, drainage, and backfill quantities. Example params: stem_height=4 m (2–8), stem_thickness_top=0.3 m (0.2–0.6), stem_thickness_bottom=0.45 m (0.25–0.9). Example call: {"params": {"stem_height": 4, "stem_thickness_top": 0.3, "stem_thickness_bottom": 0.45}, "standard": "MMHW"}. Omitted parameters use sensible engineering defaults. Pass deliverables=["xlsx","dxf","pdf"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier). Pass `freeboard` (clearance below the wall top, m) instead of the retained-height field to set the retained fill by clearance — the engine back-calculates it as stem − freeboard. Supplying both is rejected.
| Parameter | Type | Description |
|---|---|---|
| params * | object | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| freeboard | any | |
| output_mode | string | one of ["summary","material_schedule","boq","boq_with_backup","full_json"] |
| deliverables | any |
{
"name": "compute_cantilever_wall",
"title": "Compute Cantilever Retaining Wall BoQ",
"description": "Free tier. Renders the MMHW standard only — CESMM4, NRM2 and SMM7 require a paid tier. Anonymous callers welcome. In-situ reinforced concrete cantilever retaining wall with toe, heel, and stem. Includes excavation, blinding, drainage, and backfill quantities. Example params: stem_height=4 m (2–8), stem_thickness_top=0.3 m (0.2–0.6), stem_thickness_bottom=0.45 m (0.25–0.9). Example call: {\"params\": {\"stem_height\": 4, \"stem_thickness_top\": 0.3, \"stem_thickness_bottom\": 0.45}, \"standard\": \"MMHW\"}. Omitted parameters use sensible engineering defaults. Pass deliverables=[\"xlsx\",\"dxf\",\"pdf\"] (any subset) to also receive one-shot download URLs in the same call: Excel BoQ (both tiers, watermarked free) plus the dimensioned DXF (CAD) and PDF drawing sheets (paid tier). Pass `freeboard` (clearance below the wall top, m) instead of the retained-height field to set the retained fill by clearance — the engine back-calculates it as stem − freeboard. Supplying both is rejected.",
"inputSchema": {
"type": "object",
"required": [
"params"
],
"properties": {
"params": {
"type": "object",
"properties": {
"toe_length": {
"type": "number",
"default": 0.8
},
"heel_length": {
"type": "number",
"default": 1.7
},
"stem_height": {
"type": "number",
"default": 4
},
"wall_length": {
"type": "number",
"default": 25
},
"backfill_class": {
"type": "string",
"default": "Class 6N"
},
"base_thickness": {
"type": "number",
"default": 0.5
},
"blinding_grade": {
"type": "string",
"default": "C8/10"
},
"concrete_grade": {
"type": "string",
"default": "C32/40"
},
"drain_diameter": {
"type": "number",
"default": 0.15
},
"excavation_batter": {
"type": "number",
"default": 1
},
"stem_thickness_top": {
"type": "number",
"default": 0.3
},
"drain_surround_width": {
"type": "number",
"default": 0.4
},
"formation_below_base": {
"type": "number",
"default": 0.15
},
"drain_surround_height": {
"type": "number",
"default": 0.4
},
"stem_thickness_bottom": {
"type": "number",
"default": 0.45
},
"reinforcement_kg_per_m3": {
"type": "number",
"default": 130
},
"excavation_working_space": {
"type": "number",
"default": 0.6
},
"backfill_height_above_base": {
"type": "number",
"default": 3.8
}
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"freeboard": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup",
"full_json"
],
"type": "string",
"default": "full_json"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"required": [
"result"
],
"properties": {
"result": {
"anyOf": [
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"anyOf": [
{
"type": "object",
"required": [
"assembly_slug",
"standard",
"parameters_used",
"boq_rows",
"totals_summary",
"text_summary"
],
"properties": {
"drawing": {
"anyOf": [
{
"type": "object",
"required": [
"svg_b64",
"viewbox_x",
"viewbox_y",
"viewbox_width",
"viewbox_height",
"entity_count"
],
"properties": {
"svg_b64": {
"type": "string",
"minLength": 1
},
"viewbox_x": {
"type": "number"
},
"viewbox_y": {
"type": "number"
},
"entity_count": {
"type": "integer",
"minimum": 0
},
"viewbox_width": {
"type": "number",
"exclusiveMinimum": 0
},
"viewbox_height": {
"type": "number",
"exclusiveMinimum": 0
},
"unit_of_drawing": {
"type": "string",
"const": "m",
"default": "m"
}
},
"description": "Schema § 1.6a — inline server-rendered SVG preview of the geometry.\n\nThe MCP mirror of the web ``/compute`` response's ``drawing`` field\n(``api.schemas.compute.DrawingRef``): the same on-screen dimensioned\ndrawing both tiers see in the workspace, surfaced on the MCP compute\nresponse so a chat client can render it inline (60th-fire item C). This\nis the on-screen preview — present on BOTH tiers per the free/paid\nboundary; the downloadable CAD artefacts (DXF / dimensioned PDF) remain\nthe paid differentiator via the export tools.\n\nDefined here rather than importing ``DrawingRef`` because the web\n``schemas`` package imports back into this module (``schemas.render``),\nso reusing it would create an import cycle — the MCP wire contract keeps\nits own copy, the same pattern as ``BoQRow`` / ``DrawingReference``.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"boq_rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"work_section",
"description",
"quantity",
"unit",
"attribution"
],
"properties": {
"rate": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"unit": {
"type": "string",
"minLength": 1
},
"amount": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"default": null
},
"audit_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"quantity": {
"type": "number",
"minimum": 0
},
"attribution": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string",
"minLength": 1
},
"work_section": {
"type": "string",
"minLength": 1
}
},
"description": "Schema § 1.3 — a single bill row in the requested standard's format.\n\n`description` is the non-verbatim functional description per spec § 13.9 /\n§ 15 invariant — NEVER reproduces a standard's verbatim clause text.\n`rate` / `amount` ship null because rates are commodity data the customer\nowns; the engine's job is the measurement, not the pricing.",
"additionalProperties": false
}
},
"drawings": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"drawing_type",
"format",
"url",
"sheet_size",
"scale"
],
"properties": {
"url": {
"type": "string",
"minLength": 1
},
"scale": {
"type": "string",
"minLength": 1
},
"format": {
"enum": [
"DXF",
"PDF",
"SVG"
],
"type": "string"
},
"layers": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"sheet_size": {
"enum": [
"A1",
"A2",
"A3",
"A4"
],
"type": "string"
},
"drawing_type": {
"enum": [
"section",
"plan",
"elevation",
"isometric",
"detail"
],
"type": "string"
}
},
"description": "Schema § 1.6 — paid-tier drawing artefact pointer.\n\n`url` is an R2-signed URL; expiry is carried in `_meta.deliverables.expires_at`\non the envelope (not duplicated here). `layers` is DXF-only; PDF/SVG\ncallers omit it.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"severity",
"message"
],
"properties": {
"code": {
"type": "string",
"minLength": 1
},
"detail": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"message": {
"type": "string",
"minLength": 1
},
"severity": {
"enum": [
"info",
"advisory",
"caution"
],
"type": "string"
},
"affected_params": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.8 — a non-fatal geometry advisory (56th-fire T2).\n\nThe wire projection of the engine's `core.GeometryWarning`. Advisory only:\na warning NEVER changes a measured quantity — it flags geometry that is\nvalid but likely a mistake (e.g. a stale dependent-height default). Present\non BOTH tiers — a correctness/safety signal, not a paid feature.",
"additionalProperties": false
}
},
"audit_trail": {
"anyOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"boq_row_index",
"derivation"
],
"properties": {
"id": {
"type": "string",
"minLength": 1
},
"formula": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"derivation": {
"type": "string",
"minLength": 1
},
"boq_row_index": {
"type": "integer",
"minimum": 0
},
"parameters_referenced": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "Schema § 1.7 — paid-tier audit-trail entry.\n\nOne entry per BoQ row; `boq_row_index` ties to the row position in\n`ComputeResult.boq_rows`. `derivation` is the human-readable formula\nwalk-through; `formula` is the optional formal expression.",
"additionalProperties": false
}
},
{
"type": "null"
}
],
"default": null
},
"text_summary": {
"type": "string",
"maxLength": 2000,
"minLength": 1
},
"assembly_slug": {
"type": "string",
"minLength": 1
},
"totals_summary": {
"type": "object",
"properties": {
"entries": {
"type": "object",
"additionalProperties": {
"type": "object",
"required": [
"quantity",
"unit"
],
"properties": {
"unit": {
"type": "string",
"minLength": 1
},
"quantity": {
"type": "number",
"minimum": 0
}
},
"description": "Schema § 1.4 — single material/work-class total entry.",
"additionalProperties": false
}
}
},
"description": "Schema § 1.4 — totals_summary as a typed wrapper around the free-form dict.\n\nWire shape is a flat object (`{\"concrete_m3\": {...}, \"rebar_t\": {...}}`).\nWe model it as `RootModel`-equivalent via `model_config(extra=\"allow\")`\n+ a single `__root__`-style `entries` dict. Pydantic v2 recommends\n`RootModel` for free-form roots; using a wrapper class keeps the import\nsurface uniform with the rest of this module.",
"additionalProperties": false
},
"parameters_used": {
"type": "object",
"properties": {
"assumptions": {
"type": "array",
"items": {
"type": "string"
}
},
"user_supplied": {
"type": "object",
"additionalProperties": true
},
"engine_defaults": {
"type": "object",
"additionalProperties": true
}
},
"description": "Schema § 1.2 — the parameter snapshot the engine actually used.\n\nSplits user-supplied values from engine defaults so customers can see\nwhich numbers came from them and which the engine filled in. Every\ndefaulted parameter SHOULD have a corresponding entry in `assumptions`\n— the bridge layer enforces this when wrapping engine output.",
"additionalProperties": false
}
},
"description": "Schema § 1.1 — the typed payload returned inside `MCPResponse[ComputeResult]`.\n\nFree-tier responses omit `drawings` (the downloadable CAD artefact\npointers — the paid differentiator); the bridge enforces this. The\n`audit_trail` and the inline `drawing` preview are present on BOTH tiers\n(V1 ALIGN / 60th-fire D + C). `text_summary` is bounded to 2000 chars —\nkeeps the LLM-facing summary token-cheap and forces longer narrative into\nBoQ row descriptions where it belongs. `warnings` is the non-fatal\ngeometry advisory list (both tiers).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"_meta"
],
"properties": {
"data": {
"title": "Data",
"default": null
},
"_meta": {
"type": "object",
"required": [
"request_id",
"issued_at",
"tier"
],
"properties": {
"hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"tier": {
"enum": [
"free",
"paid"
],
"type": "string"
},
"tos_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"issued_at": {
"type": "string",
"minLength": 1
},
"request_id": {
"type": "string",
"minLength": 1
},
"document_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"output_mode": {
"anyOf": [
{
"type": "object",
"required": [
"mode",
"omitted_fields",
"retrieve_with"
],
"properties": {
"mode": {
"enum": [
"summary",
"material_schedule",
"boq",
"boq_with_backup"
],
"type": "string"
},
"retrieve_with": {
"type": "string",
"minLength": 1
},
"omitted_fields": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"description": "Surfaces what a trimmed ``output_mode`` withheld from ``data``.\n\nA trimmed mode (``summary`` / ``material_schedule`` / ``boq`` /\n``boq_with_backup``) withholds\nalready-computed fields to keep the chat payload small. The withheld value\nreads to a client agent as \"capability missing\" (the box-culvert \"geometry\nbuilder isn't firing\" scare) rather than \"pared for size\": ``drawing`` and\n``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]``\n(its type forbids ``null``) — both indistinguishable from a genuine absent\nresult. This names the withheld fields and the exact mode that brings each\nback, so the value is unambiguous. Absent on the default ``full_json`` mode\n— nothing is withheld, nothing to point at.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"deliverables": {
"anyOf": [
{
"type": "object",
"required": [
"expires_at"
],
"properties": {
"dxf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"pdf_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"docx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"xlsx_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"expires_at": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.3 — R2 signed URLs (24h TTL).",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"tier_upgrade": {
"anyOf": [
{
"type": "object",
"required": [
"available_tiers"
],
"properties": {
"pass_credit": {
"anyOf": [
{
"type": "object",
"required": [
"amount_local",
"currency",
"redeemable_until"
],
"properties": {
"currency": {
"type": "string"
},
"applies_to": {
"type": "string",
"const": "solo_first_month",
"default": "solo_first_month"
},
"amount_local": {
"type": "number"
},
"redeemable_until": {
"type": "string"
}
},
"description": "Canonical schema § 0.7 — pass-credit upgrade hook.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"pricing_url": {
"type": "string",
"default": "https://civilquants.com/pricing"
},
"current_tier": {
"type": "string",
"const": "free",
"default": "free"
},
"available_tiers": {
"type": "array",
"items": {
"type": "object",
"required": [
"tier_slug",
"display_name",
"price_local",
"currency",
"billing",
"unlock_summary"
],
"properties": {
"billing": {
"enum": [
"one_off",
"monthly",
"annual"
],
"type": "string"
},
"currency": {
"enum": [
"GBP",
"SGD",
"EUR",
"USD",
"CAD",
"AUD",
"NZD",
"MYR"
],
"type": "string"
},
"tier_slug": {
"enum": [
"7_day_pass",
"solo",
"studio",
"practice"
],
"type": "string"
},
"price_local": {
"type": "number"
},
"display_name": {
"type": "string"
},
"unlock_summary": {
"type": "string",
"minLength": 1
}
},
"description": "Canonical schema § 0.7 — single tier in the upgrade carousel.",
"additionalProperties": false
}
}
},
"description": "Canonical schema § 0.7 — present on free-tier responses only.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"upgrade_hint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"schema_version": {
"type": "string",
"const": "1.0.0",
"default": "1.0.0"
},
"scope_boundary": {
"anyOf": [
{
"type": "object",
"required": [
"produced",
"not_in_scope"
],
"properties": {
"produced": {
"type": "array",
"items": {
"type": "string"
}
},
"not_in_scope": {
"type": "array",
"items": {
"type": "string"
}
},
"recommended_companions": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.6 — surfaces what this assembly produces vs not.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
},
"warranty_disclaimer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null
},
"rate_limit_remaining": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.2 — present on every MCPResponse.\n\nRequired fields: `schema_version`, `request_id`, `issued_at`, `tier`.\nThe free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`,\n`tier_upgrade`, `rate_limit_remaining`) are populated by the middleware\nwhen `tier == \"free\"`; absent on paid-tier responses.",
"additionalProperties": false
},
"error": {
"anyOf": [
{
"type": "object",
"required": [
"code",
"message",
"recoverable"
],
"properties": {
"code": {
"enum": [
"RATE_LIMIT_EXCEEDED",
"TIER_INSUFFICIENT",
"INVALID_INPUT",
"SCHEMA_VERSION_MISMATCH",
"SCHEMA_INVARIANT_VIOLATION",
"UPSTREAM_TIMEOUT",
"BACKEND_FAILURE",
"IP_BLOCKED",
"RESOURCE_NOT_FOUND",
"RENDER_FAILURE",
"OCR_LOW_CONFIDENCE",
"MANUAL_REVIEW_REQUIRED",
"ACCEPTANCE_REQUIRED",
"INVALID_TOKEN"
],
"type": "string",
"description": "Canonical schema § 0.5 catalogue.\n\nEach member maps to a documented `recoverable` flag (see\n`IS_RECOVERABLE`) — clients use the flag to decide retry vs surface."
},
"details": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"message": {
"type": "string",
"minLength": 1
},
"recoverable": {
"type": "boolean"
},
"retry_after_seconds": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"default": null
}
},
"description": "Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.",
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false
}
]
}
},
"x-fastmcp-wrap-result": true
},
"annotations": {
"readOnlyHint": true
}
}Compute one sectioned/linear assembly across multiple sections in a single call and return a combined Bill of Quantities plus per-section results. Each section sets its own run_length and geometry; shared_params apply to all sections. Use for a wall, kerb run, drain or barrier that changes along its length. assembly_slug must be a sectioned assembly (e.g. cantilever_wall, kerb_run, edge_drain); non-linear items return INVALID_INPUT. Free tier: MMHW only, each section consumes one daily slot. Example: {"assembly_slug":"cantilever_wall","standard":"MMHW","sections":[{"label":"Bay 1","run_length":20,"stem_height":1.5},{"label":"Bay 2","run_length":15,"stem_height":2.4}]}.
| Parameter | Type | Description |
|---|---|---|
| sections * | array | |
| standard | string | one of ["CESMM4","NRM2","SMM7","MMHW"] |
| deliverables | any | |
| aggregate_boq | boolean | |
| assembly_slug * | string | |
| shared_params | any | |
| include_backup | boolean | |
| include_section_boq | boolean |
{
"name": "compute_multi_section_assembly",
"title": "Compute multi-section assembly BoQ",
"description": "Compute one sectioned/linear assembly across multiple sections in a single call and return a combined Bill of Quantities plus per-section results. Each section sets its own run_length and geometry; shared_params apply to all sections. Use for a wall, kerb run, drain or barrier that changes along its length. assembly_slug must be a sectioned assembly (e.g. cantilever_wall, kerb_run, edge_drain); non-linear items return INVALID_INPUT. Free tier: MMHW only, each section consumes one daily slot. Example: {\"assembly_slug\":\"cantilever_wall\",\"standard\":\"MMHW\",\"sections\":[{\"label\":\"Bay 1\",\"run_length\":20,\"stem_height\":1.5},{\"label\":\"Bay 2\",\"run_length\":15,\"stem_height\":2.4}]}.",
"inputSchema": {
"type": "object",
"required": [
"assembly_slug",
"sections"
],
"properties": {
"sections": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"standard": {
"enum": [
"CESMM4",
"NRM2",
"SMM7",
"MMHW"
],
"type": "string",
"default": "MMHW"
},
"deliverables": {
"anyOf": [
{
"type": "array",
"items": {
"enum": [
"xlsx",
"dxf",
"pdf"
],
"type": "string"
}
},
{
"type": "null"
}
],
"default": null
},
"aggregate_boq": {
"type": "boolean",
"default": true
},
"assembly_slug": {
"type": "string"
},
"shared_params": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"default": null
},
"include_backup": {
"type": "boolean",
"default": false
},
"include_section_boq": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
},
"outputSchema": {
"truncated": true,
"chars": 22510
},
"annotations": {
"readOnlyHint": true
}
}30 more tools not shown here; see the raw JSON.
CivilQuants — QS-grade parametric estimating engine. Exposes 46 compute_<slug> tools (one per assembly), a render_skill_report tool for BoQ deliverables (Excel + Word), four project tools (save_project, get_project, list_projects, recompute_project) for paid-tier subscribers, and ten senior-QS skill methodologies (tender review + risk, QS measurement/contract advice, geotechnical + geo-environmental interpretation, earthworks, preliminaries, pavement design, subcontract analysis) reachable via the list_skills + get_skill tools (paid tier). The document-heavy skills require a code-execution client (Claude Code / Codex / VS Code) and the chunking pack from get_document_pipeline to run a real tender pack — on a chat connector you can read the methodology but cannot chunk/parse documents; the Word adjudication pack renders customer-side via word-report-base (get_document_pipeline component='render'), not server-side. Anonymous callers may use the six free-tier compute tools (attenuation_tank, cantilever_wall, end_area_earthworks, gully, headwall, manhole) and the Excel render skill — all other tools return a TIER_INSUFFICIENT envelope until OAuth-based subscription resolution lights up. The free tier renders the MMHW standard only; CESMM4, NRM2 and SMM7 require a paid tier. Saved projects: save_project creates a new project each call; to revise a parameter, fetch the stored assemblies with get_project, amend them, call save_project again (suffix the name, e.g. 'R02'), then recompute — recompute_project takes no parameter overrides. In a later conversation, re-find saved work with list_projects or get_project by exact name. Pass deliverables=["xlsx","dxf","pdf"] (any subset) on a compute call for one-shot download URLs: Excel BoQ (both tiers) plus dimensioned DXF + PDF drawing sheets (paid tier). For linear assemblies (pipe runs, kerbs, drains, barriers, channels), always confirm the run length with the user before computing — quantities scale directly with it and an unstated run length is the most common source of error. Read civilquants://intro for positioning and the free/paid boundary, and civilquants://catalogue for the full assembly picker with tiers. A compute response is large; pass output_mode='summary' or 'boq' to get a trimmed payload in chat (default returns the full result). For a procurement take-off (what to order — the aggregate quantity of each material, no priced bill), pass output_mode='material_schedule'. Trimmed modes null already-computed fields (the dimensioned drawing, the audit trail, sometimes the bill rows) to save tokens — that is paring, NOT a missing capability; _meta.output_mode lists what was omitted and the mode that returns it. Example: "Measure a 1200 mm manhole 3 m deep to MMHW." Not sure which tool to call? Describe the job in words and call resolve_assembly_from_description — it routes you to the right assembly and lists the fields you'll need, then you call compute_<slug>.
Names, descriptions and schemas were written by the server and are shown as data.