arkgate
v4.9.0When the agent writes a bad import, the write doesn’t land.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ark_identity
First call. Prove this MCP process is the right project: pass project.expectedRoot (exact absolute root) and reuse the returned projectId. Do this before any other Ark tool. A missing/unmatched root or processPackage.processStale means restart/retarget the host and use the project-local CLI until identity and package versions align.
| Parameter | Type | Description |
|---|---|---|
project | object |
ark_manifest
Return the machine-readable architecture contract with an authoritative project binding when project.expectedRoot matches this MCP project. Prefer this tool over the ark://manifest compatibility resource, whose standard MCP read shape cannot carry a portable project expectation.
| Parameter | Type | Description |
|---|---|---|
project | object |
validate_code
Single-file lexical check of a source snippet against Ark's architecture (forbidden infra imports, unknown intents, layer-reference violations, and the enforced ArkRun / ArkRules structure / ArkOrder sensors CI runs on that file). One file can never prove the whole candidate, so the result is always partial: valid:false and isError:true until complete-candidate preflight. Read lexicalValid and violations for the snippet verdict; use ark_prepare_change (or arkgate-check) for a green result. For hard write-path blocking use the `arkgate-mcp --hook` PreToolUse hook, not this tool. Returns { valid…
| Parameter | Type | Description |
|---|---|---|
source * | string | Full source text about to be written. |
filePath | string | Target file path (used to infer layer and for messages). |
layer | string | Architecture layer of the target file (e.g. DomainModel). If omitted, inferred from filePath via ark.config.json layer patterns. |
project | object |
ark_check
Scan the project for architecture findings (layer-import violations, forbidden globals, cycles, config warnings). Returns pass/fail/incomplete plus evidence — not a yes/no architecture score. Same engine as arkgate-check. Applies the baseline when one exists. isError when the scan fails. Prefer after ark_identity.
| Parameter | Type | Description |
|---|---|---|
baseline | boolean | Suppress pre-frozen violations via .ark-baseline.json. Default: auto (on when the file exists). |
project | object | |
strict | boolean | Fail on config warnings too (--strict-config). Default true. |
ark_policy_delta
Classify a complete ark.config.json transition as strengthening, neutral, judgment-required, or weakening. Pass the previous baseConfig and optional candidateConfig (defaults to this project contract). Weakening and judgment-required results set isError unless acknowledgement exactly matches both policy hashes and all blocking finding ids, and adrPath names a short note under docs/adr/ or docs/decisions/. Read-only; never edits the contract.
| Parameter | Type | Description |
|---|---|---|
baseConfig * | object | Previous complete ark.config.json object. |
acknowledgement | object | Optional schemaVersion/basePolicyHash/candidatePolicyHash/findingIds/reason object. When the transition needs an acknowledgement, adrPath must name a short note under docs/adr/ or docs/decisions/. |
baseArkRuleFiles | object | Base ArkRules catalog as data: { "<path from baseConfig.arkRules>": <ArkRules file JSON> }. Required when baseConfig maps arkRules; otherwise the call is refused rather than classifying ArkRule demoti… |
candidateArkRuleFiles | object | Candidate ArkRules catalog as data, same shape. Defaults to the files on disk when candidateConfig is omitted or maps the same arkRules files as the project contract (the project ark.config.json passe… |
candidateConfig | object | Candidate complete config; defaults to the current project contract. |
project | object |
ark_coverage
Report what each layer actually governs: per-layer file counts, the FULL list of unclassified (ungoverned) files, layers whose patterns match nothing, and layers with no rule edge. Use this to audit config coverage instead of hand-rolling find/readdir. Report only — never an error.
| Parameter | Type | Description |
|---|---|---|
project | object |
ark_place
Place a file in the architecture: filePath is required (fail-closed without it — never invents components/*.tsx or defaults to Presentation). Returns layer, mayImport / mustNotImport, forbiddenGlobals, and goldenPattern (load-bearing for NEW code when .ark/golden-pattern.json exists — adopt generates it). When the matched layer has layers[].description, the JSON includes description; the field is omitted when absent. When the matched layer has layers[].trustBoundary (public|auth|admin|internal), the JSON includes trustBoundary; omitted when absent. When the matched layer has layers[].owner…
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Path (relative to project root or absolute) of the file to place. |
description | string | What you are building. Does not invent a path — pass filePath. Without filePath the tool fail-closes. |
project | object |
ark_prepare_write
Prepare a write against the architecture contract: place (filePath required; fail-closed without it — never invents a path) + constrain (layer, mayImport, mustNotImport, forbiddenGlobals) + validate source + optional mechanical-safe autoPatch + judgmentBrief when judgment is needed + contentHash for host commit. Also returns the versioned new/worsened designDelta for the proposed full file. Composes ark_place + write-gate. Fallback when the host has no trusted hard pre-hook (or that hook is fail-open). When a hard hook is installed, the host already gates the write; this tool stays available…
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Target path (preferred). Used for layer inference and autoPatch resolution. |
source * | string | Full source text about to be written. |
description | string | What you are building (hint only). Does not invent a path — pass filePath. Without filePath the tool fail-closes. |
layer | string | Optional explicit layer override (otherwise inferred from filePath). |
project | object |
ark_prepare_change
Validate one complete governed-source create/update/delete batch as an atomic in-memory candidate. Catches cross-file forbidden edges and cycles before any host write, and returns per-file content hashes plus base/candidate tree and policy hashes. Never writes files.
| Parameter | Type | Description |
|---|---|---|
changes * | array | Full candidate batch. Each item is {path, content} for create/update or {path, delete:true}. |
changeMap | object | Optional strict schema 1.0 architecture change map. Omit it to use ordinary atomic preflight. |
project | object |
ark_recommend
Score this repository against templates/architecture-playbook.json and return the tool-agnostic application shape to adopt (archetype, preset, phased layer plan, analogy, anti-patterns). Same structured output as ark-check --recommend --json. Call BEFORE generating project structure on greenfield or early-adoption repos.
| Parameter | Type | Description |
|---|---|---|
project | object |
ark_suggest_include
Propose ark.config.json include roots from workspaces and nested TypeScript packages (polyglot-safe). Same idea as ark-check --suggest-include. Use when coverage is empty or the contract misses package roots.
| Parameter | Type | Description |
|---|---|---|
project | object |
ark_rules_inventory
Deterministic brownfield rules inventory (AR13): validation-in-controller, magic constants, anemic entities, mutation-without-guard. Returns honest counts (inventoried/under-contract/frozen) — never a numeric score. Same plane as ark-check --rules-inventory.
| Parameter | Type | Description |
|---|---|---|
project | object |
ark_status
Unified session/project status manifest (ACS03): project identity binding, honest write-path activation, last-check summary, ArkRules residual counts, and primary next action. Same envelope as `ark status --json`. Never prompts; never a numeric score. Prefer after ark_identity so project.expectedRoot is bound.
| Parameter | Type | Description |
|---|---|---|
project | object |