Docs/The MCP server/Tool reference

Tool reference: every MCP tool and its parameters.

What an AI coding agent can call over MCP, grouped into specification, goal, template and workflow tools.

Every tool acts on the one workspace the connection is bound to. IDs come from the replies of other tools, such as specification_id from list_specifications. A branch_id names a draft or a proposal. “You” is the caller: your account over browser sign-in, or its own agent user with an API key. Agents read each tool description from the server; this list is for people checking what an agent can do. Parameters are strings unless marked otherwise. Unknown parameters are refused before the tool runs, with an error listing the accepted parameters. Other errors can happen after part of a call has succeeded: submit_goal, for example, records artifacts before submitting, so those artifacts remain if the submission is refused. Read the error and the current goal before retrying.

Specification tools

list_areas

List the workspace areas, the domains such as auth or billing. Specs take area IDs, and a goal reads the areas of its spec. No parameters.

create_area

Create an area. Check list_areas first and keep areas coarse, a handful for the whole system.

nameRequiredShort domain name, such as billing
descriptionOne line

list_specifications

List every spec with its scope, sections, areas, depends_on and phase: drafting, ready, in_build or verified, and null for a foundational doc. A ready spec can still wait on an unbuilt prerequisite, an open question or a goal assigned to someone else. Documents from the organization Library appear too, marked shared and read-only here.

scopefeature or foundational. Omit for both.

search_specifications

Ranked search of published titles and content in the workspace and the organization Library. Each hit names the spec and the matched_section_id to pass to read_section. Drafts and proposals are not indexed.

queryRequiredEvery term must match and prefixes count; organization workspaces also match by meaning
scopefeature or foundational. Omit for both.
limitinteger1 to 50, default 20

read_specification

Read a spec with its sections, open drafts and proposals, criteria and their verification state, health, last_goal, depends_on and needed_by.

specification_idRequired

create_specification

Create a spec. Feature scope creates Product and Engineering sections. Foundational scope creates one section, in Markdown or as a Mermaid diagram; the System Architecture template creates the workspace architecture diagram.

titleRequired
scopeRequiredfeature or foundational
templatesobjectMaps product, engineering or foundational to a template ID from list_templates
areasstring[]Area IDs. Omit for workspace-wide.
formatmarkdown (default) or mermaid, foundational only. A template format wins.

rename_specification

Change the title of a spec.

specification_idRequired
titleRequired

retag_specification

Replace the areas of a spec. An empty list makes it workspace-wide.

specification_idRequired
areasstring[]RequiredThe full set of area IDs

set_spec_dependencies

Set the specs a feature spec builds on, replacing the current set. Its goals cannot be claimed until each prerequisite is built: no unfinished goal, and a finished goal or every criterion verified. A cycle is refused.

specification_idRequiredA feature spec
depends_onstring[]RequiredDirect prerequisites only. Empty clears.

verify_existing_criteria

For a spec written from code that already exists: mark every criterion nobody has claimed or reviewed as agent verified, so the spec reads verified, plan_build skips it, and it counts as built. Never for code the agent wrote, which goes through submit_goal. Refused while a goal on the spec is in progress or in review.

specification_idRequired

read_section

Read the published content of one section and the spec version.

specification_idRequired
section_idRequired
branch_idA draft or proposal instead. Not with version.
versionintegerThe section as it was at that spec version

Result

Use the returned content and content_hash when editing a draft. Pass the hash as expected_content_hash to update_draft.

diff_specification

Show what changed between two published versions: the versions in between and, per changed section, only the blocks that differ.

specification_idRequired
fromintegerDefault: the version the last finished goal built through
tointegerDefault: the current version

create_draft

Open a section in a draft of the spec; each section you open lands in the same draft. With goal_id it is the goal's draft, which submit_goal proposes: never create_proposal it. After a send-back the same call finds it again; while the goal is in review it answers goal_in_review. Without goal_id it is your own draft, for changing another document. Refused while a draft of yours from another base is open.

specification_idRequired
section_idRequired
goal_idThe goal whose draft this edit belongs in. On the goal's own spec, always pass it. Not with from_branch_id.
from_branch_idAn open proposal to revise; create_proposal adds the draft back into it
all_sectionsbooleanWith from_branch_id, open every section the proposal touches

Result

The branches entry identifies the draft. Use its ID as branch_id to read and update the section.

update_draft

Replace one section of your draft, keeping the template headings. In a Product or Engineering section, each - [ ] item at the left margin becomes a tracked AC-n criterion on publish: rewording one replaces it, removing one retires it, and the checkbox state is ignored. A fenced mermaid block renders as a diagram in the web app.

specification_idRequired
section_idRequired
branch_idRequiredThe draft
contentRequiredMarkdown. A diagram document takes raw Mermaid source with no fence.
expected_content_hashThe hash you last read. A mismatch refuses the write instead of overwriting.

Result

Keep the stored content and content_hash from the reply for further edits; the server normalizes checklist spacing.

Recovery

For stale_content, read the section again with the draft's branch_id, merge your edits with the current text, and retry with the fresh hash.

Example: edit a goal's draft

These are tool arguments, not shell commands. Replace the placeholders with IDs from tool replies. First, read_specification returns the section IDs. Open the section with create_draft:

create_draft
{
  "specification_id": "<specification_id>",
  "section_id": "<section_id>",
  "goal_id": "<claimed_goal_id>"
}

Take the draft ID from the reply's branches entry and pass it as branch_id to read_section:

read_section
{
  "specification_id": "<specification_id>",
  "section_id": "<section_id>",
  "branch_id": "<draft_id>"
}

Edit the returned content, keeping the template headings and the text you are not changing. Pass the complete revised section to update_draft, with the content_hash from that read:

update_draft
{
  "specification_id": "<specification_id>",
  "section_id": "<section_id>",
  "branch_id": "<draft_id>",
  "content": "<complete revised section content>",
  "expected_content_hash": "<content_hash from read_section>"
}

If the hash no longer matches, read the section again and merge the changes before retrying. Keep the returned stored text and hash for any further edits. Finish through submit_goal, which proposes this draft.

create_proposal

Submit your own draft for review, every section at once: the way to change another document.

specification_idRequired
branch_idRequiredThe draft
resolutionsobject[]One object per conflict you resolve, using the fields below. Omit on the first call.
Each resolutions entry
FieldRequiredDetails
section_idRequiredThe conflicting section ID.
contentRequiredThe complete resolved section text.
proposal_content_hashRequiredThe hash supplied with that conflict.

Restrictions

Not for a goal's draft: use submit_goal. Calling this on one returns goal_draft_proposes_at_submit.

Result

Returns proposal_id. It joins the proposal the draft was opened from, otherwise the spec's open non-goal proposal, otherwise starts a new one. The submitted draft is no longer editable; revise the proposal with create_draft and from_branch_id.

Recovery

A conflict reply lists conflicting sections. Merge each section's text and retry with resolutions. If a proposal hash has moved, resolve the newly returned conflict with its fresh hash.

discard_proposal

Delete a proposal and its history: your own, one linked to a goal, or one SpecDeck wrote. To revise a proposal instead, create_draft with from_branch_id.

specification_idRequired
branch_idRequiredThe proposal

publish_draft

Publish a draft or proposal as the next version of the spec, without review; the reply carries published_version. A conflicting section is refused with the conflicts listed. Use it only when the person says to skip review. A workspace can require review for agents over MCP or on an API key; publishing is then refused, and submit_goal or create_proposal is the way.

specification_idRequired
branch_idRequiredThe draft or proposal

Goal tools

Four calls carry feedback on a goal: ask_question, record_decision, submit_goal and release_goal.

list_goals

List the goals in the workspace: id, specification, title, status, assignee and timestamps per goal. read_goal returns the brief and criteria.

statusidle, in_progress, in_review or done
specification_idOnly the goals on this specification.

read_goal

Read a goal: first its briefing (why earlier runs ended, open decisions, prerequisite branches not yet on the main branch, the documents that apply), then the brief, status, assignee, actions, artifacts, scoped criteria and the open submission.

goal_idRequired

create_goal

Create an idle, unassigned goal on a feature spec. The spec needs a published version with at least one criterion, and can hold only one goal that is not done.

specification_idRequiredA feature spec
titleRequiredUnder 80 characters
summaryThe brief in Markdown: ## Scope, plus ## Setup when the work changes how the system runs or starts from a branch other than main. At most 20000 bytes.
scopestring[]The AC-n handles to build, those not yet verified. Omit when none is verified, to scope every active criterion.

get_next_goal

Claim the next idle goal you may take, your own first, and set it in_progress. Skips goals waiting on a person, an unbuilt prerequisite or another goal on the spec, and goals assigned to someone else. Takes over a goal whose agent has been silent for eight hours. Returns no_goals_available when nothing is claimable.

specification_idClaim the goal of that spec. Answers no_active_goal, or not_claimable with a reason: in_progress, in_review, assigned, needs_input, blocked or spec_not_ready.

submit_goal

Hand implementation back for review with one claim per scoped criterion not yet verified, plus each criterion added or reworded in the goal's draft. Submission also proposes that draft.

goal_idRequired
criteriaobject[]Claims using the fields below. Omit only when no scoped or new draft criterion needs a claim.
spec_branch_idOptional explicit branch selection. Normally omit: submission finds the goal's own draft or proposal. An agent cannot submit a personal branch (not_goal_proposal).
artifactsobject[]Evidence to record before submission. An existing identical artifact is not recorded twice.
Each criteria entry
FieldRequiredDetails
idOne of id or itemAn existing AC-n handle or criterion UUID from read_goal. Never with item.
itemOne of id or itemFor a criterion added or reworded in the goal's draft: its exact new - [ ] text. Never with id. The claim lands on the new criterion when published.
statusRequiredmet or unmet. See the claim meanings below.
testsFor met: tests or evidenceAn array of 1 to 50 test names or paths when supplied.
evidenceFor unmet; or instead of tests for metHow the agent verified the behavior, or what is missing and how a person can check it.
Each artifacts entry
FieldRequiredDetails
typeRequiredbranch, commit, pull_request, deployment, test_report or ci_run.
valueRequiredBranch name, commit SHA or URL. A pull_request takes its web URL.
environmentFor deployment onlylocal, dev, qa, stage or prod. Required for deployment and refused for other types.

Claim meanings

met means the agent verified the criterion, supported by tests or evidence. unmet means the agent could not verify it: verification may be missing, or the behavior may be known to fail. Explain which in evidence. Every unmet claim needs evidence and a deployment artifact pointing at a running build the reviewer can access.

Result

The goal moves to in_review for a person to check and finish. notices flags changes to the spec or prerequisites during the build. Read the current goal to inspect its open submission. A goal with no scoped criteria is marked done directly, unless an agent submits a spec change: then a person marks it done.

Common errors and recovery
ErrorWhat to do
decisions_not_writtenWrite each listed decision into the goal's own draft, then resubmit.
criteria_incompleteAdd a claim for each listed scoped criterion.
new_items_unclaimedClaim each new or reworded draft criterion with item instead of its old id.
deployment_requiredAdd an accessible deployment artifact, then resubmit.
not_goal_proposalLeave out spec_branch_id. Keep edits in the goal's own draft, opened with goal_id.
submission_openRead the goal first. To continue editing, withdraw the submission with update_goal status in_progress.

Before retrying

Artifacts are recorded first and remain even when submission is refused. Use read_goal to check artifacts, status and the current submission before retrying.

Example: submit claims with evidence

This example assumes read_goal lists two scoped criteria: AC-1 covers saving a renamed item, and AC-2 covers keyboard focus. Replace the goal ID, criterion handles and evidence with the actual work. These are arguments to submit_goal:

submit_goal
{
  "goal_id": "<claimed_goal_id>",
  "criteria": [
    {
      "id": "AC-1",
      "status": "met",
      "tests": [
        "todo.rename.test.ts: saves the new name after reload"
      ],
      "evidence": "The rename persistence test passed against the updated app."
    },
    {
      "id": "AC-2",
      "status": "unmet",
      "evidence": "Browser verification is still needed. Open the local app, rename an item with Enter, and check that keyboard focus returns to that item."
    }
  ],
  "artifacts": [
    {
      "type": "deployment",
      "value": "http://localhost:3000",
      "environment": "local"
    }
  ]
}

The met claim needs tests or evidence; it does not require both. The unmet claim needs evidence explaining what remains to check, plus a deployment artifact the reviewer can access. Here that reviewer runs the app on the same machine. Artifacts are recorded first, so this deployment satisfies that requirement in the same call.

For a criterion added or reworded in the goal's draft, replace the claim's id with item containing its exact new - [ ] ... text. Never pass both. Leave out spec_branch_id; submission finds the goal's draft itself.

update_goal

Change the status, assignee, title, brief or scope of a goal; reassigning hands the work off.

goal_idRequired
statusidle, in_progress or done
assignee_idUser ID of a person or an agent
titleUnder 80 characters
summaryThe whole brief, replaced. Must keep ## Scope. At most 20000 bytes.
setupReplaces only the body of ## Setup. Not with summary; no line starting with ## .
reasonWith idle on your own goal: why you hand it back. At most 4000 bytes.
scopestring[]Replacement AC-n handles. Frozen while in review.

Restrictions

An agent cannot take an idle goal assigned to someone else or set in_review. Setting done is refused when the goal scopes criteria (verification_required), or is in review, has a draft spec change or an open decision (submit_to_finish). Use submit_goal to hand work back for review.

Result

Setting idle on your own goal hands it back. Setting idle or in_progress on a goal in review withdraws its submission; use in_progress to keep working.

release_goal

Hand a goal back: it goes idle and unassigned, and the next agent reads the reason in read_goal. To wait for an answer from a person instead, use ask_question, which keeps the goal yours.

goal_idRequired
reasonRequiredWhat is done, what is left, what stopped you. At most 4000 bytes.

record_decision

Record one choice where the spec is silent or wrong that would change the spec if adopted, and why; never implementation detail or scope. Write the change into the goal's draft first: add a new item rather than append to one. A deviation is a decision too. The goal keeps running. A person adopts or rejects it next to the change, and a rejection sends the goal back with the reason.

goal_idRequired
decisionRequiredOne choice and why, in a sentence or two

ask_question

Ask a person and wait: the only call that stops the goal. Use it for how the spec should read, a contradiction between documents, or a change the rest of the work waits on (written into the goal's draft first). The goal goes idle and stays yours. The agent is not notified of the answer: tell it to continue, and its next get_next_goal resumes the goal.

goal_idRequired
contentRequiredThe question
proposed_optionsstring[]2 to 5 answers a person picks with one click, each at most 200 bytes

add_artifact

Record evidence on a goal. Add the git branch when you create it and the pull request URL when you open it, so a git host integration can match the pull request and show when it lands. A landed pull request never changes the goal status.

goal_idRequired
typeRequiredbranch, commit, pull_request, deployment, test_report or ci_run
valueRequiredBranch name, commit SHA or URL; for pull_request, its web URL
environmentlocal, dev, qa, stage or prod. Required for deployment, refused for other types.

update_artifact

Change the value or environment of an artifact. The type is fixed.

goal_idRequired
artifact_idRequired
value
environmentlocal, dev, qa, stage or prod

remove_artifact

Remove an artifact from a goal.

goal_idRequired
artifact_idRequired

Template tools

list_templates

List the section templates for create_specification. A template kind must match the section it fills.

kindproduct, engineering or foundational

Workflow tools

Each returns the steps of the prompt of the same name for the agent to follow, and changes nothing itself. A value outside the ones listed is refused; a missing one takes the default.

onboard_codebase

Return the steps that turn the code in the working directory into specs. See Onboard an existing codebase.

modeplan (default) or autonomous
outputpropose (default) or publish

plan_build

Return the steps that plan the build of every spec that is ready, rendered from the workspace. No parameters.

install_agents_md

Return the steps that install or refresh the Working with SpecDeck section. They show the change and wait for a yes before writing.

fileRelative to the repository root. Default: AGENTS.md
Continue reading
Connect and run agents
The MCP server
Connect an agent, run the prompts and follow the agent workflow.
→