Constructdocs
section · guides

Mcp Tools

40 min read·guides / reference / mcp-tools

MCP Tools Reference

Construct exposes a Model Context Protocol (MCP) server consumed by Claude Code, OpenCode, and any other MCP-compatible host. Tools are registered in lib/mcp/server.mjs and implemented across lib/mcp/tools/. Most tools are hand-maintained in HARDCODED_TOOL_DEFS; a new tool may instead self-register by exporting TOOL_DEFS/TOOL_HANDLERS from a \<name>.tool.mjs file under lib/mcp/tools/lib/mcp/tool-registry.mjs scans and merges these into the same catalog with no edit to server.mjs, and requires an inline safety classification on every def.

Tool surface (gateway)

To keep the serialized tool schema small enough for any context window — a flat 77-tool surface (~15k tokens) overran a 32k local-model window — ListTools exposes a curated core plus the call gateway and the find_tool discovery tool. The core front-loads the read/think tools (orchestration_policy, orchestration_run, orchestration_readiness, get_skill, get_template, search_skills, suggest_skills, knowledge_search, memory_search, project_context, summarize_diff, find_tool) and the high-value action tools agents reach for directly (author_artifact, document_export, publish_run, artifact_workflow, triage_recommend), since burying those behind the gateway made the common case the failing case. Every other tool stays reachable through call, and find_tool ranks the whole catalog by intent so the surface scales without a hand-maintained list (ADR-0048).

find_tool

Find Construct tools by intent when you do not know the exact name. Pass a natural-language query (and optional limit) describing the task; returns the best-matching tools with their full input schemas, ranked by hybrid local-embedding semantic similarity merged with normalized BM25 — degrading to BM25-only when no semantic model is provisioned, so it works offline. Then invoke a result via call (or directly when it is a flat tool). E.g. find_tool({ query: "export a markdown file to pdf" })document_export.

call

Invoke any non-core Construct tool by name. Pass the tool name in tool (constrained to the catalog of available tools) and its arguments in args — e.g. call({ tool: "workflow_status", args: { run_id } }). The description lists namespaced tool groups and points to find_tool for intent-based discovery rather than enumerating every tool. Dispatches to the same handler as a direct call, so collapsing the surface costs no capability. The former name construct_call (and any construct-mcp_-prefixed tool name) is recovered tolerantly and the miss is recorded, so a stale or mis-typed name still resolves.

Host wiring policy

The Construct MCP server (construct-mcp) is defined once in specialists/org (mcpServers) and wired into every selected host by scripts/sync-specialists.mjs — Claude Code (project scope: .mcp.jsonmcpServers; global scope: ~/.claude.json → top-level mcpServers — settings.json carries hooks/permissions only, never MCP server definitions), OpenCode (.opencode/opencode.json), VS Code (.vscode/mcp.jsonservers), Cursor (.cursor/mcp.jsonmcpServers), and Codex (.codex/config.tomlmcp_servers). The host-config-parity functional test fails if any selected host drops it.

Credential handling diverges because hosts resolve env references at different times:

  • OpenCode — defer. OpenCode keeps the {env:VAR} reference verbatim and resolves it at runtime. A server whose token env var is unset at sync time is still wired; it only fails to authenticate later if the variable is still missing when the host launches it.
  • Codex — omit. Codex has no runtime env interpolation, so it needs the credential at sync time. codexMcpEnvResolves checks each server's bearer_token_env_var; an entry whose token is unresolved is omitted from .codex/config.toml rather than written with a dangling reference. Servers with no credential requirement — including construct-mcp itself, a local stdio server — always pass.

The result: OpenCode never blocks on a missing optional credential, and Codex never ships an entry that cannot authenticate.

Project tools

agent_health

Returns agent health summaries from the most recent performance review.

ParameterTypeDescription
agent_namestring (optional)Filter to a specific agent name

summarize_diff

Summarizes the git diff between the current state and a base ref.

ParameterTypeDescription
base_refstring (optional)Git ref to diff against (default: HEAD~1)
cwdstring (optional)Working directory

scan_file

Scans a file for secrets and code quality issues.

ParameterTypeRequiredDescription
file_pathstringYesAbsolute path to the file

Returns: { secrets, quality_issues, clean }. Quality checks: file too long (>800 lines), functions too long (>50 lines), TODO/FIXME markers.

project_context

Returns project context: .construct/context.md content, recent commits, and working tree status.

ParameterTypeDescription
cwdstring (optional)Project directory (default: process.cwd())

workflow_status

Returns current workflow state, task alignment, and public health surface.

ParameterTypeDescription
cwdstring (optional)Project directory

Document tools

extract_document_text

Extracts readable text from a local document. Supports PDF (macOS), text, and office formats.

ParameterTypeRequiredDescription
file_pathstringYesAbsolute or relative path to the document
max_charsnumberNoMax characters to return (default: 20,000; hard cap: 200,000)

ingest_document

Converts a local document into a normalized markdown file placed in an indexed project path.

ParameterTypeRequiredDescription
file_pathstringYesSource document path
out_pathstringNoExplicit markdown output path
out_dirstringNoDirectory for output files
targetstringNoknowledge/internal | knowledge/external | knowledge/decisions | knowledge/how-tos | knowledge/reference
cwdstringNoProject root
syncbooleanNoSync to SQL/vector storage after writing

document_export

Converts a markdown file into a distributable document — PDF, DOCX, legacy .doc (LibreOffice), deck HTML, PPTX, HTML, RTF, ODT, EPUB, LaTeX, plain text, or Markdown — via Pandoc and Typst (PDF engine). Optional pptxgenjs (PPTX) and LibreOffice (.doc) are discovered at runtime (ADR-0024); when tooling is absent, returns a structured {ok:false, missing:[...], message:"Install pandoc..."} instead of crashing. Use detect_only=true to check availability without running an export.

ParameterTypeRequiredDescription
formatpdf, docx, doc, deck, pptx, html, rtf, odt, epub, tex, txt, md, mdxYesTarget format
input_pathstringNo (yes unless detect_only)Absolute path to the markdown source
output_pathstringNoAbsolute output path; defaults to \<input>.\<format> next to the source
detect_onlybooleanNoReport binary availability without exporting (default false)

publish_detect

Detects availability of the full publish pipeline: Pandoc/Typst export, pandoc-ext/diagram figure rendering, VHS terminal demos, and Playwright dashboard demos. Mirrors construct tools detect and construct publish --detect.

ParameterTypeRequiredDescription
formatpdf, docx, doc, deck, pptx, html, rtf, odt, epub, tex, txt, md, mdxNoExport format to probe (default pdf)
figuresbooleanNoInclude figure binaries (default true)
demostringNoWhen set, require VHS/asciinema for terminal demo
dashboard_demostringNoWhen set, require Playwright workspace for dashboard demo

publish_run

Runs the publish pipeline: export markdown with optional figure filter and optional demo recordings. Mirrors construct publish. Use dry_run=true to probe tooling only without writing output.

ParameterTypeRequiredDescription
input_pathstringYesAbsolute path to markdown research brief
output_pathstringNoOptional output path for export
formatpdf, docx, doc, deck, pptx, html, rtf, odt, epub, tex, txt, md, mdxNoTarget format (default pdf)
demostringNoTerminal tape name to record
dashboard_demostringNoDashboard Playwright demo spec basename
figuresbooleanNoRender diagrams (default true)
strictbooleanNoFail when tooling missing (default true)
source_onlybooleanNoWrite sources only (default false)
dry_runbooleanNoDetect tooling only (default false)

infer_document_schema

Infers a structured field schema from a document (or reconciles across multiple documents).

ParameterTypeDescription
file_pathstringSingle document path
file_pathsstring[]Multiple documents for unified schema inference
max_charsnumberMax chars to send to the model (default: 40,000)
savebooleanWrite schema as .schema.json under .construct/knowledge/reference/schemas/
cwdstringProject root
sample_sizenumberMax docs to sample for unified inference (default: 10)
thresholdnumberMin fraction of docs a field must appear in (default: 0.5)

list_schema_artifacts

Lists all inferred schema artifacts (.schema.json files) in the project.

ParameterTypeDescription
cwdstring (optional)Project directory to search

Storage tools

storage_status

Returns SQL, local vector index, and ingested-artifact status for the current project.

ParameterTypeDescription
cwdstring (optional)Project directory
projectstring (optional)Explicit project key for SQL document counts

storage_sync

Syncs file-state documents into the local vector index and configured SQL storage.

ParameterTypeDescription
cwdstring (optional)Project directory
projectstring (optional)Explicit project key

storage_reset

Resets SQL/vector storage state for a project. Requires explicit confirm: true.

ParameterTypeDescription
cwdstring (optional)Project directory
projectstring (optional)Explicit project key
reset_sqlbooleanSet false to keep SQL state
reset_vectorbooleanSet false to keep vector index
reset_ingestedbooleanSet true to also delete ingested markdown artifacts
confirmbooleanRequired: must be true

delete_ingested_artifacts

Deletes ingested markdown artifacts. Requires explicit confirm: true.

ParameterTypeDescription
cwdstring (optional)Project directory
filesstring[] (optional)Relative file paths under .construct/knowledge/. Omit to delete all.
confirmbooleanRequired: must be true

Skills tools

list_skills

Lists all available categories and playbooks in the Construct knowledge base.

get_skill

Reads a specific skill playbook from the knowledge base. Pass specialistId when reading on a specialist's behalf: if that specialist has a non-empty entitlement list and the skill is not on it, the response carries an entitlement warning (or, under CONSTRUCT_STRICT_SKILLS=1, an error instead of the content) — entitlement is advisory by default, since a bare MCP call carries no authenticated specialist identity to enforce against.

ParameterTypeRequiredDescription
pathstringYesRelative path to the skill (without .md extension, e.g. security/security-arch)
specialistIdstringNoThe specialist this read is on behalf of (e.g. cx-reviewer or reviewer), for entitlement checking. Accepts either the specialistId or agentId name.
agentIdstringNoAlias for specialistId.

search_skills

Searches for a pattern within the Construct knowledge base skills.

ParameterTypeRequiredDescription
patternstringYesRegex pattern to search for

get_template

Reads a doc template by name. Resolves .construct/templates/docs/{name}.md first, then templates/docs/{name}.md.

ParameterTypeRequiredDescription
namestringYesTemplate name without .md extension (e.g. prd, adr, runbook)

list_templates

Lists shipped and project-override doc templates.

agent_contract

Looks up agent-to-agent service contracts from specialists/contracts.json.

ParameterTypeDescription
idstring (optional)Exact contract id (e.g. architect-to-engineer)
producerstring (optional)Producer agent name: returns outgoing contracts
consumerstring (optional)Consumer agent name: returns incoming contracts

worker_run

Runs a bounded shell command via the worker plane and optionally records evidence on a named task graph node. Wraps lib/worker/run.mjs:runJob.

ParameterTypeRequiredDescription
commandstringYesShell command to run (e.g. npm test)
argsstring[]Argv to pass alongside the command (when not embedded in the command string)
workspaceRefstringAbsolute path the job runs in. Must be inside allowedPaths (default: cwd)
allowedPathsstring[]Path allowlist for the workspace. Default: [cwd]
timeoutSecondsnumberHard timeout. Default: 300
envPolicystringrestricted (default: PATH/HOME/USER/TZ/LANG plus allowedEnvKeys) or inherit
allowedEnvKeysstring[]Additional env keys allowed through under restricted policy
graphIdstringOptional task graph id: when present with nodeId, evidence is recorded on that node
nodeIdstringOptional task graph node id: when present with graphId, evidence is recorded
evidenceTypestringtest-result (default), lint-result, build-result, manual-verification, …
evidenceSummarystringOptional override for the evidence summary string
traceIdstringOptional traceId to correlate with the rest of the agent's trace

Returns the job result ({status, exitCode, stdoutPath, stderrPath, durationMs, artifacts, traceId}) plus an evidence field when a graph node was named. Stdout/stderr land under .construct/runtime/worker/\<jobId>.{stdout,stderr}.log. Emits worker.started / worker.completed trace events from inside runJob and an evidence.recorded event when evidence is appended.

broker_check

Queries the MCP broker's policy gate for a pending action without executing it. Use BEFORE attempting a high-risk action so the response (allowed / approvalRequired / reason / source) can be surfaced in the agent's voice rather than triggering a denial after the fact.

ParameterTypeRequiredDescription
rolestringYesPersona name (e.g. engineer, security): must match a key in specialists/role-manifests.json for team / enterprise mode
toolstringYesTool the agent wants to invoke (e.g. github, fs)
actionstringYesAction on that tool (e.g. create_pr, edit:lib/foo.mjs)
projectstring (optional)Project scope for the decision
riskstring (optional)low | medium | high: high actions need approval for non-autonomous roles
traceIdstring (optional)TraceId to correlate this check with the rest of the agent's trace

Returns { allowed, reason, approvalRequired, source, brokerActive }. Solo mode returns brokerActive: false with allowed: true so agents skip the prompt overhead when the broker is inactive. Always emits a tool.called trace event for audit-trail parity.

orchestration_policy

Classifies a request into intent, execution track, specialists, and approval boundaries.

For research-shaped requests, the response also carries researchExecutionPolicy: a surface-agnostic evidence ladder that says when to use local evidence, knowledge_search, Context7, direct official-doc web fetches, or other domain-primary sources. Hosts should follow that policy instead of assuming Context7 exists.

ParameterTypeDescription
requeststringUser request or objective text
fileCountnumberApproximate number of files involved
moduleCountnumberApproximate number of modules involved
introducesContractbooleanWhether the change introduces a new contract
explicitDrivebooleanWhether drive/full-send mode is active
approvalobjectApproval-boundary flags (scopeChange, productDecision, riskAcceptance, etc.)

R&D-loop primitives

The intake, task-graph, and worker plane are surfaced through the construct intake, construct graph, and construct storage CLIs rather than MCP tools at this stage. The underlying modules are importable for agents that want to plan + execute programmatically:

ModuleSurface
lib/intake/classify.mjsclassifyRdIntake({sourcePath, extractedText, related}) returns the triage block. Deterministic, no LLM.
lib/intake/queue.mjscreateIntakeQueue(rootDir, env) returns a queue implementing {enqueue, listPending, count, read, markProcessed, markSkipped, reopen}: Postgres-backed in team / enterprise mode, filesystem-backed in solo.
lib/task-graph/generate.mjsgenerateTaskGraphFromTriage({triage, project, request, intake}) derives the plan-of-work from a triage packet.
lib/task-graph/store.mjsFilesystemTaskGraphStore: .save / .read / .list / .updateNodeStatus against .construct/task-graphs/.
lib/context-router.mjsbuildContextPacket({request, triage, role, candidates, budget}): per-role artifact bundle with explicit omitted reasons.
lib/mcp/broker.mjsBroker.invoke({role, tool, action, risk, execute}): policy-gated MCP wrapper for team / enterprise. Throws typed PolicyDenied, ApprovalRequired, RateLimited.
lib/worker/run.mjsrunJob({rootDir, job}): bounded command execution with path-policy denial, timeout, restricted env, and trace event emission.
lib/worker/evidence.mjsevidenceFromJobResult, recordEvidence, blockedPacket, needsInputPacket: typed verification packets gating node transitions.
lib/worker/trace.mjsemitTraceEvent({rootDir, eventType, traceId, …}): writes .construct/traces/\<date>.jsonl and exports remotely when configured.

list_teams

Lists all available team templates with members, focus, and promotion gates.

suggest_skills

Ranks skills from the central catalog for a natural-language intent.

ParameterTypeRequiredDescription
intentstringYesTask description or keywords
specialistIdstringNoOptional cx-* id for entitlement hints
limitnumberNoMax suggestions

Telemetry tools

cx_trace

Records an agent trace through the shared telemetry adapter. Local JSONL capture is always available; remote export is optional.

ParameterTypeRequiredDescription
namestringYesAgent name (e.g. cx-engineer)
idstringNoTrace UUID (auto-generated if omitted)
session_idstringNoSession ID to group related spans
metadataobjectNoExtra metadata
inputstring or objectNoAgent goal or user request
outputstring or objectNoAgent deliverable or response

Returns: { trace_id }: pass to cx_score and cx_trace_update.

cx_trace_update

Updates an existing telemetry trace with output and metadata.

ParameterTypeRequiredDescription
trace_idstringYesTrace ID from cx_trace
outputstring or objectNoFinal output
metadataobjectNoAdditional metadata to merge

cx_score

Attaches a quality score to a trace through the shared telemetry adapter.

ParameterTypeRequiredDescription
trace_idstringYesTrace ID from cx_trace
namestringYesScore name (use "quality")
valuenumberYesScore from 0.0 (poor) to 1.0 (excellent)
commentstringNoBrief explanation

session_usage

Returns locally recorded token and cost usage for the current Construct session.

ParameterTypeDescription
cwdstring (optional)Project directory
home_dirstring (optional)Home directory override

efficiency_snapshot

Returns the read-efficiency snapshot for the current session (repeated reads, large reads, hot-spot files).

ParameterTypeDescription
home_dirstring (optional)Home directory override

Memory tools

memory_search

Searches the observation store for patterns, decisions, and insights across sessions.

ParameterTypeRequiredDescription
querystringYesSemantic search query
rolestringNoFilter by specialist role
categorystringNoFilter by category: pattern, anti-pattern, dependency, decision, insight
projectstringNoFilter by project name
limitnumberNoMax results (default: 10)

memory_add_observations

Records observations discovered during work. Indexed for semantic search and surfaced in future sessions.

ParameterTypeRequiredDescription
observationsarrayYesUp to 10 observations. Each: { role, category, summary, content, tags, confidence }

memory_create_entities

Tracks recurring entities (components, services, APIs).

ParameterTypeRequiredDescription
entitiesarrayYesUp to 10 entities. Each: { name, type, summary, observation_ids }

memory_recent

Returns the most recent observations for the current project, deduplicated by (role, summary).

ParameterTypeDescription
cwdstring (optional)Project directory
projectstring (optional)Project name filter
limitnumber (optional)Max observations (default: 10, max: 50)

session_list

Lists Construct sessions for the current project.

ParameterTypeDescription
cwdstring (optional)Project directory
statusstring (optional)Filter: active, completed, closed
limitnumber (optional)Max results (default: 20)

session_load

Loads a full distilled session record by ID.

ParameterTypeRequiredDescription
session_idstringYesSession ID to load
cwdstringNoProject directory

session_search

Searches sessions by keyword in summary or project name.

ParameterTypeRequiredDescription
querystringYesSearch keyword
cwdstringNoProject directory

session_save

Updates the active session with distilled context.

ParameterTypeRequiredDescription
session_idstringYesSession ID to update
summarystringNoBrief summary (2-3 sentences)
decisionsstring[]NoKey decisions made
files_changedarrayNo[{ path, reason }]
open_questionsstring[]NoUnresolved questions or blockers
task_snapshotarrayNo[{ id, subject, status }]
statusstringNoactive, completed, or closed

rovo_search

Cross-system semantic search via Atlassian Rovo. Searches Jira, Confluence, and other accessible sources.

ParameterTypeRequiredDescription
querystringYesSearch query
top_knumberNoMax results (default: 10, max: 50)
sourcesstringNoComma-separated source filter (e.g. "jira,confluence")

Knowledge & provider tools

knowledge_search

Searches Construct's own documentation, knowledge base, and distilled embed observations. Call this for any question about how Construct works.

ParameterTypeRequiredDescription
querystringYesNatural-language question or keyword
top_knumberNoMax excerpts to return (default: 5)
repo_rootstringNoRepo root override
root_dirstringNoData directory override for embed observations

provider_fetch

Looks up current data for a configured repo, project, or team. Resolves the right provider source automatically from configured GITHUB_REPOS, JIRA_PROJECTS, or LINEAR_TEAMS.

ParameterTypeRequiredDescription
querystringYesUser's question or project/repo name
root_dirstringNoData root override

provider_write

Destructive. Governed external write to a contract-adapter provider (jira, confluence, github). dry_run defaults to true and only renders the would-write diff from the adapter's validation path (renderDryRun) — no network call, no side effect. Executing (dry_run: false) requires the out-of-band destructive-gate approval_token; the write then dispatches through the J2 envelope (lib/writes/envelope.mjs) — idempotency key, sent-log dedup, retry, audit — to the governed-write adapter. The adapter's write() is never called directly by this tool. When specialist_id names an embedded specialist, the proposed \<provider>.\<item.type> token is checked against that specialist's LMCP-E4 embedBindings grant before either mode proceeds.

ParameterTypeRequiredDescription
providerstringYesjira | confluence | github
itemobjectYesWrite payload; shape depends on provider (e.g. { type: 'issue', project, summary } for jira)
dry_runbooleanNoDefault true. When true, returns the validated diff only.
specialist_idstringNoEmbedded-specialist caller id; enforces that specialist's embedBindings grant.
idempotency_keystringNoExplicit idempotency key forwarded to the J2 envelope.
approval_tokenstringRequired to executeOut-of-band destructive-gate token.

Workflow orchestration tools

workflow_init

Initialize a new workflow for the current project. Creates plan.md state if not already present and returns the initial workflow envelope.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
titlestringWorkflow title shown in the plan header (default: "Untitled workflow").
spec_refstringOptional reference to a spec/PRD/ADR id this workflow implements.

workflow_add_task

Add a task to the current workflow. Pass request for intent-based routing (the classifier picks track + specialist) or pass explicit task fields (key, title, etc.) for manual entry.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
requeststringNatural-language task request; when present, intent-based routing is used and the explicit fields below act as overrides.
keystringStable task key (e.g. T-001). Generated when omitted.
titlestringShort task title.
phasestringPhase bucket (plan, build, validate, ship, etc.).
ownerstringSpecialist or persona that owns the task.
filesarrayFile paths this task touches.
readFirstarrayFiles the owner should read before editing.
doNotChangearrayFiles/regions the owner must not modify.
acceptanceCriteriaarrayAcceptance criteria as a checklist.
verificationstringCommand(s) or description of how to verify the task is done.
dependsOnarrayTask keys this task depends on.
overlaysarrayRole flavors that augment the owner persona for this task.
challengeRequiredbooleanForce a cx-reviewer challenge (devil's-advocate overlay) before the task can complete.
challengeStatusstringInitial challenge status when seeded.
tokenBudgetnumberPer-task token budget for cost tracking.
statusstringInitial status override.

workflow_update_task

Update fields on an existing workflow task. Requires the task key. Only fields supplied are changed.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
keystringrequired — Task key to update.
statusstringNew status (pending, in_progress, blocked_needs_user, blocked_by_dep, done, etc.).
ownerstringNew owner persona.
phasestringNew phase bucket.
notestringAppend-only progress note.
verificationstringUpdated verification description.
overlaysarrayReplace the overlay list.
challengeRequiredbooleanToggle whether a challenge is required.
challengeStatusstringUpdate the challenge status (proposed, accepted, refused, etc.).

workflow_needs_main_input

Mark a workflow task as blocked pending user input. Sets status to blocked_needs_user and writes a packet describing the blocker for the orchestrator to surface.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
taskKeystringrequired — Task key to mark blocked.
workerstringSpecialist that needs input (default: current owner).
blockerstringrequired — One-line description of what is blocking progress.
questionstringrequired — The specific question to put to the user.

workflow_validate

Validate the current workflow state against the schema and run consistency checks (no orphan tasks, no circular dependencies, every owner resolves to a known persona).

ParameterTypeDescription
cwdstringProject root (default: server cwd).

workflow_contract_validate

Validate a producer→consumer handoff against specialists/contracts.json. Required when a specialist hands off to another role: enforces input.mustContain, output schema, disk-artifact postconditions, and binary postconditions per producer (rubber-stamp prevention, post-hoc threat-model prevention, etc.). Self-enforcing: a producer with binary rules MUST pass packet, or the call itself is a contract violation.

ParameterTypeDescription
producerstringrequired — Producer agent or persona name (e.g. cx-reviewer, cx-security).
consumerstringrequired — Consumer agent or persona name receiving the handoff.
idstringOptional contract id; overrides producer/consumer lookup.
artifactobjectThe handoff payload to validate against the contract schema and disk-artifact postconditions.
packetobjectThe producer's in-memory output packet. REQUIRED when the producer has binary postconditions; omitting it is itself a contract violation.
enforcementstringEnforcement mode (default: block). Use warn only when explicitly advisory.

workflow_import_plan

Bulk-add tasks from a markdown plan to the current workflow. Parses headings and bullet structure to extract task titles, owners, and acceptance criteria.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
markdownstringrequired — Plan markdown to parse.
phasestringPhase bucket applied to all imported tasks.
ownerstringDefault owner for tasks that do not specify one.
readFirstarrayDefault readFirst files applied to all imported tasks.
doNotChangearrayDefault doNotChange files applied to all imported tasks.
acceptanceCriteriaarrayDefault acceptance criteria applied to all imported tasks.
titlestringWorkflow title to set if the workflow is newly created.
spec_refstringSpec reference to associate with the workflow.

Profile, outcomes & learning tools

scope_show

Return the active Construct org profile (id, displayName, roles, departments, intake taxonomy, doc templates). Use when a specialist needs to know which role set, classification taxonomy, or doc templates apply before drafting work.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
idstringForce a specific profile id instead of resolving from config.

scope_list

List the curated org profile catalog (rnd, operations, creative, research) with role/department counts. Use to discover which profiles are available before suggesting construct scope set.

No parameters.

scope_drafts

List in-progress draft profiles under .construct/profiles/draft-* and any user-defined custom profile at .construct/scope.json. Use to see what profile work is pending before scaffolding another draft.

ParameterTypeDescription
cwdstringProject root (default: server cwd).

scope_health

Per-profile health rollup over a window: observation count, per-role outcome runs and success rates. Use to check whether a profile is producing data before recommending changes or archive.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
idstringProfile id (default: active profile).
window_daysnumberWindow in days (default 30).

scope_create

Scaffold a draft org profile under .construct/profiles/draft-\<id>/ (requirements.md + profile.json + persona stubs + department charters). Writes durable state — requires confirm=true. For curated catalog work, follow docs/guides/concepts/profile-lifecycle.md after creation.

ParameterTypeDescription
confirmbooleanrequired — Must be true.
cwdstring
idstringrequired — Profile id (^[a-z][a-z0-9-]{1,30}$).
display_namestring
seed_rolesarrayRole ids to scaffold persona files for (cap 80).
seed_departmentsarrayDepartments to scaffold charters for (cap 12).

scope_archive

Archive a curated profile: moves profiles/\<id>.json and its intake table into archive/profiles/\<id>/ with an archive note. Destructive — requires confirm=true and a substantive reason (>=8 chars). Observations and outcomes are preserved.

ParameterTypeDescription
confirmbooleanrequired — Must be true.
idstringrequired
reasonstringrequired — Substantive reason (>= 8 chars).

outcomes_summary

Read .construct/outcomes/_summary.json (per-role success rate, 30-day trend). Pass aggregate=true to rebuild the summary from JSONL outcome files first. Use to ground tiebreakers and improvement suggestions in real specialist performance.

ParameterTypeDescription
cwdstringProject root (default: server cwd).
aggregatebooleanRebuild _summary.json before reading (default false).

outcomes_record

Append a specialist outcome line to .construct/outcomes/\<role>.jsonl (writes durable state — requires confirm=true). Use when a specialist wants to self-report success/failure outside the automatic agent-tracker path.

ParameterTypeDescription
confirmbooleanrequired — Must be true.
cwdstring
rolestringrequired — Specialist id (e.g. cx-engineer, product-manager).
successbooleanrequired
intake_idstring
profilestringOverride active profile id stamp.
escalatedboolean
duration_msnumber
notesstringTrimmed to 500 chars.
sourcestringOrigin tag (default: "mcp").

knowledge_add

Persist a research finding as .construct/knowledge/external/research/\<slug>.md with research-specific frontmatter (topic, confidence, sources, expiresAt, profile). Writes durable state — requires confirm=true. confidence=confirmed requires at least one source.

ParameterTypeDescription
confirmbooleanrequired — Must be true.
cwdstring
slugstringrequired — Lowercase hyphenated, max 60 chars.
topicstringrequired
bodystringrequired — Findings / inferences / gaps / recommendation block. Capped at 50KB total file.
confidencestringDefault: inferred.
sourcesarrayRequired when confidence=confirmed.
ttl_daysnumberDefault 90.

knowledge_graph_ask

GraphRAG-style global query over the entity graph in .construct/observations/. Detects communities via label propagation, ranks them by BM25 against the query, and returns each top community with its central members and extractive summary. Use for "tell me about how X relates across the project" questions that pure semantic retrieval handles poorly.

ParameterTypeDescription
querystringrequired — Natural-language question.
cwdstringProject root (default: server cwd).
top_knumberMax communities to return (default 5).
min_sizenumberSkip communities smaller than this (default 2).
tagsarrayRestrict entity extraction to observations carrying these tags.
tag_matchstringTag match mode: any (default) or all.

learning_status

One-shot mirror of npm run learning:status: active profile, observation counts (last 24h + total), research finding count, per-role outcome rollup. Use to answer "is Construct learning?" without spawning a shell.

ParameterTypeDescription
cwdstringProject root (default: server cwd).

sandbox_list

List Construct sandboxes under ~/.cx/sandboxes/ (id, path, createdAt). Use to find an isolated environment for QA or dry-runs without polluting the active project.

No parameters.

Embedded contract tools

author_artifact

Materializes a typed artifact you have drafted (PRD, ADR, RFC, meta-prd, runbook, research-brief, evidence-brief) to its canonical path and runs the release gate. The calling agent is the model: it drafts the markdown, this tool persists and validates it, then returns the path and a structured PASS/FAIL verdict with errors so the draft can be fixed and re-submitted. OpenCode and other supported hosts reach this contract through the synced Construct MCP server.

ParameterTypeDescription
draft_markdownstringThe complete artifact markdown — a single # title plus the type's required ## sections.
artifact_typestringArtifact type (defaults to prd; inferred from subject when omitted).
subjectstringShort subject/title hint used for the filename and type inference.

artifact_workflow

Plans a manifest-backed artifact workflow, or performs only locally observable validation/export after approval_mode: allow-durable-write. The response separates planned, executed, and skipped steps; it never presents a planned specialist review or rewrite as completed execution.

Every artifact-workflow run reports a completion ledger — a chronological record of evidence backing each state advancement. An artifact's completionState is the highest rung of the 12-state ladder (planned → authored → structurally-valid → source-linted → exported → file-valid → renderable → screenshot-captured → visually-reviewed → accessibility-reviewed → approved → completed) for which it holds re-verifiable evidence. A state advances only with an explicit evidence object; missing tools are recorded as typed degradations (missing-dependency, unavailable-renderer, etc.) without advancing the ladder. See Artifact Completion States for the full ladder and no-forgery invariant.

ParameterTypeDescription
inputstringNatural-language artifact request.
artifact_typestringRegistered manifest document class.
file_pathstringExisting source document for local validation/export.
formatstringRequested distribution format.
output_pathstringOptional local export destination.
brandingstringconstruct (default) or explicit plain opt-out.
approval_modestringallow-durable-write is required for local validation/export.

model_resolve

Resolve which model an embedded Construct workflow should use given the host/IDE provider context. Precedence: host model → same-provider-family fallback → Construct tier default → structured config error. Never reads or returns credential values (requiresCredential is a boolean) and never claims unverified provider health. Read-only; performs no writes.

ParameterTypeDescription
workflow_typestringWorkflow type hint (e.g. evidence-ingest, prd-draft, architecture-review). Selects a tier when requested_tier is absent.
requested_tierstringDesired tier; overrides the workflow-type hint.
hoststringHost/IDE identifier (advisory).
host_modelstringModel the host is currently using (e.g. anthropic/claude-sonnet-4-6).
host_providerstringProvider family the host uses, when no host_model is given.
capabilitiesarrayOptional required capabilities; unverifiable ones are returned as warnings.
allow_cross_provider_fallbackbooleanPermit falling back outside the host provider family (default false).

triage_recommend

Classify an artifact and return a role-aware plan (primary owner, role chain with rationale, suggested skills, evidence requirements, expected outputs, approval requirements, risks, next steps, canExecute) WITHOUT enqueuing or executing. Classification confidence is reported distinctly from any generation confidence. Read-only; performs no durable write.

ParameterTypeDescription
inputstringArtifact text to classify (meeting notes, bug report, proposal, etc.). Provide this OR file_path.
file_pathstringPath to a file to extract and classify (PDF/Office via docling, audio/video via whisper, transcripts, plain text). Used when input is absent.
source_pathstringOptional filename/source hint to aid classification.
artifact_typestringOptional artifact-type hint (advisory).
domainstringOptional broad domain hint.
desired_outcomestringOptional desired outcome (advisory).
constraintsarrayOptional constraints (advisory).
available_rolesarrayRestrict the plan to these role ids; dropped roles are reported as warnings.

workflow_invoke

Invoke a named Construct workflow (roles/skills) non-interactively and return a provenanced execution plan: selected roles, rationale, applied skills, resolved model, evidence requirements, output contract, risks, and a traceId. Construct returns the orchestration plan; the host runtime performs specialist reasoning. Durable writes occur ONLY when approval_mode is allow-durable-write; proposal-only and requires-human-approval perform no durable writes.

ParameterTypeDescription
workflow_typestringrequired — One of: evidence-ingest, proposal-review, prd-draft, architecture-review, risk-review, research-synthesis.
inputstringArtifact text the workflow operates on. Provide this OR file_path.
file_pathstringPath to a file to extract (docling/whisper/transcript) and operate on, used when input is absent.
contextobjectOptional structured context; keys matching evidence requirements mark them satisfied.
role_strategystringauto = default chain; explicit = use requested_roles; constrained = default chain intersected with requested_roles.
requested_rolesarrayRole ids for explicit/constrained strategies.
approval_modestringGate for durable writes (default: the workflow type default).
tracebooleanEmit a traceId for provenance correlation (default true).
hoststringHost/IDE identifier (advisory).
host_modelstringModel the host uses, for model resolution.
host_providerstringProvider family the host uses, for model resolution.
recruitmentstringSignal-driven recruitment onto the manifest chain (construct-pteo2.9): auto (default) appends recruits, off disables. Recruits and their reasons return in recruitment; under allow-durable-write they are also recorded in the .cx/observations decision trace (construct-pteo2.18).

capability_describe

Describe what this Construct install can do: versions, contract interfaces (CLI/MCP/SDK), roles, skills, workflows, schemas, models/providers, policies, telemetry posture, and plugins. Read-only and secret-free — provider entries carry env-key names and a configured boolean only, never credential values. Reads live registries so the published contract cannot drift from reality.

ParameterTypeDescription
root_dirstringOptional Construct install root (default: server toolkit dir).

construct_execution_resolve

Resolve the execution-capability contract for an embedded workflow before/at workflow start: executionMode (construct-orchestrated | construct-prompt-only | host-direct | same-family-fallback), constructCapabilitiesActive (subset of personas/skills/workflow-routing/prompt-envelope), degraded + machine-readable degradationReason, requestedStrategy vs effectiveStrategy, and the resolved provider/model. Descriptive, not enforced (ADR-0019): reports what Construct planned and can resolve a model for, never an observation that the host ran personas (see the semantics field). Read-only and secret-free.

ParameterTypeDescription
workflow_typestringWorkflow whose orchestration plan is weighed (e.g. evidence-ingest, architecture-review). Absent ⇒ generic orchestration availability.
requested_strategystringorchestrated | prompt-only | auto (default auto).
use_constructbooleanfalse ⇒ host-direct (host runs without Construct capabilities). Default true.
hoststringHost/IDE identifier (advisory).
host_modelstringModel the host is currently using, for model resolution.
host_providerstringProvider family the host uses, when no host_model is given.
requested_tierstringreasoning | standard | fast; overrides the workflow-type hint.
capabilitiesstring[]Optional required capabilities; unverifiable ones are returned as warnings.
allow_cross_provider_fallbackbooleanPermit model fallback outside the host provider family (default false).

web_search

Search the public web and return CITED results — the only search surface that reaches the open web, kept distinct from knowledge_search / provider_fetch / repo search so it is never conflated or faked. Requires a governed provider (WEB_SEARCH_URL); without one it returns a typed degradation (capability-unavailable) and zero results, never source/repo results dressed as web. Every result carries a verifiable URL, a claim-relative class, and an Admiralty grade with derived confidence (ADR-0017; high is reserved for A1/A2/B1).

ParameterTypeDescription
querystringrequired — The search query string.
claimstringrequired — The claim the results support; drives claim-relative source classification (ADR-0017).
recencystringOptional freshness window hint (e.g. 30d).

orchestration_run

Execute a real multi-specialist orchestration run and return per-specialist output — the executing counterpart to workflow_invoke (which only plans). For MCP hosts with no subagent primitive (VS Code/Copilot, Cursor), this is how a specialist chain actually runs: the engine owns orchestration, the tool is the thin client (ADR-0022). Solo runs execute in-process — no daemon, no port, no token; a remote/team orchestration service is opt-in via CONSTRUCT_ORCHESTRATION_URL.

Three worker backends. host (the default for MCP-originated runs when neither worker_backend nor construct.config.json's orchestration.workerBackend is set) materializes each specialist's prompt without spending any provider API credits — the calling host executes it in its own model session (the subscription it is already running under) and submits the result via orchestration_task_result; when the connected client declares the MCP sampling capability, construct-mcp instead drives that same loop itself (ADR-0063) and the run can complete in this same call. provider executes specialists against a configured provider key (real API spend). inline only prepares tasks — no execution at all (this stays the CLI's own default; the CLI has no attached host session to execute a host-backend run against).

A host-backend run whose materialization completes returns status: 'awaiting-host' — a real, non-terminal standing state (never rendered as completed or degraded) — plus every task's materialized system/user prompt and a hostInstructions string describing exactly what to do next.

The response's specialists field is the real, dispatched role list — authoritative. routePath.specialistSequence can be non-empty even when specialists/tasks are empty: a short request with no scope signal (no file_count/module_count, no "end to end"/"ship"/"full" keyword) can classify as trivial and dispatch zero specialists even with requested_strategy: "orchestrated", while routePath still shows the specialist a focused classification would have picked, for display purposes. Read specialists/tasks, not routePath, to know what actually ran.

Pass candidates to route pre-retrieved artifacts to specialists as role-aware context (D3). The caller does retrieval up front; each dispatched specialist's prompt then carries a trust-wrapped ## Role context section holding only the artifact kinds its role policy prefers, within a token budget — a target-file reaches the engineer, a prd the product-manager, and a kind on a role's avoid list never reaches it. A kind: "skill" candidate is dropped for any role not entitled to that skill. The candidate list is snapshotted on the run, so a provider-executed and a host-executed task materialize the same context bytes. Omit candidates for no injected context (byte-identical to a pre-D3 prompt).

ParameterTypeDescription
requeststringrequired — Natural-language description of the work to orchestrate.
workflow_typestringOptional workflow type to shape the plan (e.g. architecture-review).
requested_strategystringorchestrated | prompt-only | auto (default auto).
worker_backendstringhost materializes prompts for the calling MCP host to execute (default for MCP-originated runs); provider executes against a configured provider key; inline prepares only.
hoststringHost/IDE identifier (advisory).
host_modelstringModel the host uses, for model resolution.
host_providerstringProvider family the host uses, for model resolution.
file_countnumberOptional planning hint: number of files in scope. Pass this (or module_count) when the work has real scope — see the specialists/routePath note above.
module_countnumberOptional planning hint: number of modules in scope.
context_targetsarrayOptional registered source targets to bind for context ([{id, role?}]); an unknown id is rejected at plan time.
candidatesarrayOptional pre-retrieved artifacts routed to specialists as role-aware context ([{path, title, kind, summary, score?, skillId?}]). Filtered per role by the context policy; a kind: "skill" entry is dropped for any role not entitled to it.
context_budgetobjectOptional {maxTokens} cap for the injected role context (default ~6000 tokens per specialist).
waitbooleanWait for a terminal state and return task output (default true); false returns the runId to poll.
timeout_msnumberMax wait when wait=true (default 120000); on timeout the runId is returned to poll.

orchestration_task_result

Submit one host-executed specialist task result for a run planned with worker_backend=host (Phase 1 of the host worker backend, ADR-0063). orchestration_run returns each task's materialized prompt without executing it; execute that prompt as the named specialist role, then call this tool with the output. The response carries next_task (the next awaiting prompt) or null once the run is terminal — loop until null. Reachable via the call gateway (self-registered, non-core tool). Recorded fields are host-reported (provenanceSource: 'host-reported') — self-reported, never independently verified, and never rendered identically to a provider-executed task's shape.

ParameterTypeDescription
run_idstringrequired — The run id from orchestration_run.
task_idstringrequired — The task id this result answers (e.g. t1).
outputstringrequired — The specialist output produced. Must be non-empty.
modelstringOptional: the model used to execute this task (self-reported).
providerstringOptional: the provider/vendor family used (self-reported).
reasoningstringOptional: reasoning/thinking for this task, if disclosed.

participation_rules

Author and inspect ADR-0070 participation rules — condition-driven when(signals) → recruit(specialists|teams) declarations with role and gate semantics (construct-pteo2.16). Every action is a thin envelope over lib/registry/org-api.mjs, the same writer construct participation and Org Studio's participation canvas wrap, so all three surfaces produce identical config writes and identical validation errors. Writes land in the project or user tier only; the builtin tier is refused at the shared org-api layer.

ParameterTypeDescription
actionstringrequired — One of list, show, add, validate, remove, preview, meta.
ownerstringOwning specialist or team id the rule attaches to (show/add/validate/remove).
rule_idstringRule id (show/remove).
ruleobjectThe participation rule (add/validate), schemas/participation-rules.schema.json shape.
requeststringSample request text (preview — recruited set via the live requestSignals + recruiter path).
scopestringWrite tier for add/remove: project (default) or user.

orchestration_readiness

Report whether this MCP session has Construct orchestration tools attached and reachable now. Returns a pass/fail verdict, typed reasonCode, one deterministic nextStep, required/observed/missing tools, and a redacted diagnostic bundle. This is an observed attachment check, unlike construct_execution_resolve, which remains a descriptive planning/model-resolution contract.

Default required tools are orchestration_policy and orchestration_run. orchestration_run may be either flat or reachable through the call gateway enum.

Reason codes: attached, host_not_attached, server_unreachable, auth_unavailable, profile_mismatch, capability_negotiation_failed, version_mismatch, tool_unlisted, unknown.

ParameterTypeDescription
hoststringHost/IDE identifier, if known.
session_idstringHost session/thread id, if known.
observed_toolsarrayOptional tool names observed by the host in tools/list. Defaults to this server catalog when called through MCP.
reachable_toolsarrayOptional long-tail tool names reachable through a gateway enum.
required_toolsarrayRequired orchestration tools. Defaults to orchestration_policy, orchestration_run.
client_contract_versionstringClient contract version for compatibility checks.
observation_scopestringhost-session or local-config. MCP calls normally use host-session.

orchestration_status

Inspect orchestration runs: pass run_id for the full shaped record (status, per-task status/executor/output/error), or omit it for a list of recent runs. Solo runs are in-process (no daemon); a remote/team orchestration service is opt-in via CONSTRUCT_ORCHESTRATION_URL, and only that path can be unreachable.

ParameterTypeDescription
run_idstringRun id to fetch. Omit to list recent runs.
limitnumberMax runs to list when run_id is omitted (default 20).

orchestration_cancel

Request cancellation of an in-progress orchestration run by run_id. A soft, cooperative cancel: the run stops cleanly before its next task (an in-flight model call is not aborted), and the request is persisted on the run so a run executing in another process observes it. Returns an error for an unknown or already-terminal run.

ParameterTypeDescription
run_idstringrequired — Run id to cancel.

Telemetry (additional)

cx_trace_telemetry

Record a single CX telemetry trace for an agent invocation. Use to log start/end, model used, token cost, and outcome verdict for performance review.

ParameterTypeDescription
agentstringrequired — Agent or persona name being traced.
traceobjectrequired — Trace record: start_ts, end_ts, model, tokens, verdict, notes, etc.
cwdstringProject root (default: server cwd).