---
title: "Mcp Project Recompute"
method: POST
path: "/api/v1/mcp/project/{project_id}/recompute"
tags: ["mcp", "project"]
---

# Mcp Project Recompute

`POST /api/v1/mcp/project/{project_id}/recompute`

## Request

- Base URL: `https://api.civilquants.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.civilquants.com/api/v1/mcp/project/{project_id}/recompute`
- Auth: none declared

Re-run every enabled assembly + render aggregated BoQs.

Default behaviour (omit ``standard_codes``) renders all four standards
so the cross-standard quantity-invariance moat (H3.5 canary) is
visible at the project level. Caller can narrow to a single standard
for token-cheap polling.

Hydration uses ``ComputeService.hydrate_assembly`` which (post Step
1.6) calls ``coerce_parameters`` to rebuild nested-dataclass list
fields safely — the underlying save→reload→recompute path is what
spec § 3.4.2 promises ("save your tender, come back tomorrow, click
recompute").

## Path parameters

- `project_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- ProjectRecomputeRequest: Body for ``POST /api/v1/mcp/project/{id}/recompute``. Empty body is allowed — omits the standards filter and renders against all four.
  - `standard_codes` string[], nullable

## Response `200`

Successful Response

- union
  - MCPResponseProjectRecomputeResponse
    - `data` ProjectRecomputeResponse
      - `project_id` string, required
      - `standards_rendered` string[], required
      - `assembly_count` integer, required
      - `work_item_count` integer, required
      - `boqs_by_standard` object, required
      - `procurement_summary` ProcurementLineOut[], required
        - `category` string, required
        - `spec` string, required
        - `quantity` number, required
        - `unit` string, required
        - `source_assemblies` string[], required
      - `assembly_drawings` AssemblyDrawingOut[], required
        - `assembly_id` string, required
        - `slug` string, required
        - `label` string, required
        - `position` integer, required
        - `drawing` DrawingRef: Server-rendered SVG preview of the assembly geometry. Per G.6.3 / STATUS.md decision 6 (2026-05-19): one source of geometry (`DrawEntity` list emitted by `Assembly.compute`), two output paths (this SVG for inline preview, the `GET .../dxf` endpoint for the real CAD download). The browser displays `svg_b64` decoded inline; `viewbox` drives client zoom/pan controls without re-parsing the SVG. `svg_b64` is base64 of a UTF-8 SVG document with one `<g class="cq-layer cq-layer-<name>">` per layer. Styling defaults are inlined so the preview renders without an external stylesheet; front-end CSS may override via the class names.
          - `svg_b64` string, required: Base64-encoded SVG document
          - `viewbox_x` number, required: SVG viewBox x in engine units (m)
          - `viewbox_y` number, required: SVG viewBox y in engine units (m)
          - `viewbox_width` number, required: SVG viewBox width in engine units (m)
          - `viewbox_height` number, required: SVG viewBox height in engine units (m)
          - `entity_count` integer, required: Number of DrawEntities rendered
          - `unit_of_drawing` 'm': Engine geometry is in metres. Surfaced here so the client never has to guess; if a future engine switches to mm this becomes the discriminator.
    - `error` ErrorEnvelope: Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.
      - `code` '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', required: Canonical schema § 0.5 catalogue. Each member maps to a documented `recoverable` flag (see `IS_RECOVERABLE`) — clients use the flag to decide retry vs surface.
      - `message` string, required
      - `recoverable` boolean, required
      - `retry_after_seconds` integer, nullable
      - `details` object, nullable
    - `_meta` ResponseMeta, required: Canonical schema § 0.2 — present on every MCPResponse. Required fields: `schema_version`, `request_id`, `issued_at`, `tier`. The free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`, `tier_upgrade`, `rate_limit_remaining`) are populated by the middleware when `tier == "free"`; absent on paid-tier responses.
      - `schema_version` '1.0.0'
      - `request_id` string, required
      - `issued_at` string, required
      - `tier` 'free' | 'paid', required
      - `document_id` string, nullable
      - `deliverables` DeliverableURLs: Canonical schema § 0.3 — R2 signed URLs (24h TTL).
        - `pdf_url` string, nullable
        - `xlsx_url` string, nullable
        - `dxf_url` string, nullable
        - `docx_url` string, nullable
        - `expires_at` string, required
      - `rate_limit_remaining` integer, nullable
      - `upgrade_hint` string, nullable
      - `tos_url` string, nullable
      - `warranty_disclaimer` string, nullable
      - `scope_boundary` ScopeBoundary: Canonical schema § 0.6 — surfaces what this assembly produces vs not.
        - `produced` string[], required
        - `not_in_scope` string[], required
        - `recommended_companions` string[], nullable
      - `tier_upgrade` TierUpgrade: Canonical schema § 0.7 — present on free-tier responses only.
        - `current_tier` 'free'
        - `available_tiers` TierOption[], required
          - `tier_slug` '7_day_pass' | 'solo' | 'studio' | 'practice', required
          - `display_name` string, required
          - `price_local` number, required
          - `currency` 'GBP' | 'SGD' | 'EUR' | 'USD' | 'CAD' | 'AUD' | 'NZD' | 'MYR', required
          - `billing` 'one_off' | 'monthly' | 'annual', required
          - `unlock_summary` string, required
        - `pricing_url` string
        - `pass_credit` PassCreditOffer: Canonical schema § 0.7 — pass-credit upgrade hook.
          - `amount_local` number, required
          - `currency` string, required
          - `redeemable_until` string, required
          - `applies_to` 'solo_first_month'
      - `hint` string, nullable
      - `output_mode` OutputModeInfo: Surfaces what a trimmed ``output_mode`` withheld from ``data``. A trimmed mode (``summary`` / ``material_schedule`` / ``boq`` / ``boq_with_backup``) withholds already-computed fields to keep the chat payload small. The withheld value reads to a client agent as "capability missing" (the box-culvert "geometry builder isn't firing" scare) rather than "pared for size": ``drawing`` and ``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]`` (its type forbids ``null``) — both indistinguishable from a genuine absent result. This names the withheld fields and the exact mode that brings each back, so the value is unambiguous. Absent on the default ``full_json`` mode — nothing is withheld, nothing to point at.
        - `mode` 'summary' | 'material_schedule' | 'boq' | 'boq_with_backup', required
        - `omitted_fields` string[], required
        - `retrieve_with` string, required
  - MCPResponseAny
    - `data` unknown
    - `error` ErrorEnvelope: Canonical schema § 0.4 — error payload returned in `MCPResponse.error`.
      - `code` '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', required: Canonical schema § 0.5 catalogue. Each member maps to a documented `recoverable` flag (see `IS_RECOVERABLE`) — clients use the flag to decide retry vs surface.
      - `message` string, required
      - `recoverable` boolean, required
      - `retry_after_seconds` integer, nullable
      - `details` object, nullable
    - `_meta` ResponseMeta, required: Canonical schema § 0.2 — present on every MCPResponse. Required fields: `schema_version`, `request_id`, `issued_at`, `tier`. The free-tier-only fields (`upgrade_hint`, `tos_url`, `warranty_disclaimer`, `tier_upgrade`, `rate_limit_remaining`) are populated by the middleware when `tier == "free"`; absent on paid-tier responses.
      - `schema_version` '1.0.0'
      - `request_id` string, required
      - `issued_at` string, required
      - `tier` 'free' | 'paid', required
      - `document_id` string, nullable
      - `deliverables` DeliverableURLs: Canonical schema § 0.3 — R2 signed URLs (24h TTL).
        - `pdf_url` string, nullable
        - `xlsx_url` string, nullable
        - `dxf_url` string, nullable
        - `docx_url` string, nullable
        - `expires_at` string, required
      - `rate_limit_remaining` integer, nullable
      - `upgrade_hint` string, nullable
      - `tos_url` string, nullable
      - `warranty_disclaimer` string, nullable
      - `scope_boundary` ScopeBoundary: Canonical schema § 0.6 — surfaces what this assembly produces vs not.
        - `produced` string[], required
        - `not_in_scope` string[], required
        - `recommended_companions` string[], nullable
      - `tier_upgrade` TierUpgrade: Canonical schema § 0.7 — present on free-tier responses only.
        - `current_tier` 'free'
        - `available_tiers` TierOption[], required
          - `tier_slug` '7_day_pass' | 'solo' | 'studio' | 'practice', required
          - `display_name` string, required
          - `price_local` number, required
          - `currency` 'GBP' | 'SGD' | 'EUR' | 'USD' | 'CAD' | 'AUD' | 'NZD' | 'MYR', required
          - `billing` 'one_off' | 'monthly' | 'annual', required
          - `unlock_summary` string, required
        - `pricing_url` string
        - `pass_credit` PassCreditOffer: Canonical schema § 0.7 — pass-credit upgrade hook.
          - `amount_local` number, required
          - `currency` string, required
          - `redeemable_until` string, required
          - `applies_to` 'solo_first_month'
      - `hint` string, nullable
      - `output_mode` OutputModeInfo: Surfaces what a trimmed ``output_mode`` withheld from ``data``. A trimmed mode (``summary`` / ``material_schedule`` / ``boq`` / ``boq_with_backup``) withholds already-computed fields to keep the chat payload small. The withheld value reads to a client agent as "capability missing" (the box-culvert "geometry builder isn't firing" scare) rather than "pared for size": ``drawing`` and ``audit_trail`` appear as ``null``, ``boq_rows`` as an empty list ``[]`` (its type forbids ``null``) — both indistinguishable from a genuine absent result. This names the withheld fields and the exact mode that brings each back, so the value is unambiguous. Absent on the default ``full_json`` mode — nothing is withheld, nothing to point at.
        - `mode` 'summary' | 'material_schedule' | 'boq' | 'boq_with_backup', required
        - `omitted_fields` string[], required
        - `retrieve_with` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/civilquants/apis/civilquants-api.md) · [All operations](https://skmtc.dev/civilquants/apis/civilquants-api/llms.txt) · [OpenAPI document](https://skmtc.dev/civilquants/apis/civilquants-api/revisions/84569a3761e1?raw)
