Skip to content
eknath

Specs

The specification is the product

Keel is written spec first. The JSON Schemas below define every document in a workspace, and the 36 tool definitions are the exact files the MCP server registers its tools from. Contract tests check that code, examples and specs agree, so what you read here is what runs.

How the specs are used

Schemas are the contract

A collection, an item, a workflow and the workspace config are each a JSON Schema. Every file Keel reads or writes is validated against them, and examples (valid and invalid, fake data only) are tested too.

Tools come from files

Each MCP tool is one JSON file: its name, the description an agent reads, its safety tier, MCP hints and its input schema. Adding a tool is a file plus one handler; nothing else changes.

Tests keep them honest

Every tool has an implementation and the other way round, hints match the tier, only outbound tools leave the machine, and a fixture workspace from every release is opened and upgraded.

Conventions

  • Every document has schema_version (0 for now; it changes only with a migration).
  • Every collection and item has a title and a description: agents read them to find and reuse things.
  • state_since on an item is the day it entered its current state. Keel sets it on creation and on every move; nobody writes it by hand. The retention_days config setting (default 90) says how long finished work stays in now before it overflows into the changelog.
  • A secret is {"secret_ref": "env:NAME"} or {"secret_ref": "keychain:NAME"}. Never a value.
  • Schema ids use the urn:keel:spec: prefix and are versioned.

Schemas

Collectioncollection.schema.json

A user-defined category of items (test accounts, product links, API references, ...). Every collection and item carries a title and a description so an agent can discover and reuse it.

Workspace configurationconfig.schema.json

Everything project-specific that is safe to share lives here, never in code: the workspace name, projects and folders, enabled modules. Personal settings such as outbound connectors live in local/connectors.json.

Connectors (personal, git-ignored)connectors.schema.json

Where outbound messages may go. Lives in the workspace's local/ folder, never in git: chat ids and variable names are personal.

Itemitem.schema.json

One entry of a collection. Sub-items point at their parent. A field of type secret never holds a value: it holds a reference to an environment variable or a keychain entry.

MCP tool specificationtool.schema.json

One MCP tool: its name, the description an agent reads, its safety tier, MCP hints and the JSON Schema of its input. The server registers its tools from these files.

Workflowworkflow.schema.json

The states an item of a collection moves through, the allowed moves between them, and the rules a move must satisfy. A team's process (for example a Definition of Done) is data here, not code.

All files are in spec/ in the repository, with the examples the tests use.

MCP tools

Three tiers: read tools only look, write tools change the workspace under its rules and are logged, outbound tools leave the machine and always show a preview first. There is no delete tool.


36 of 36 tools

Read tools (17)

Safe to call any time: they look and never change anything.

briefing

read

What is in flight, open and done, state by state, for each workflow collection. Call it at the start of a session.

Full description

What is in flight, open and done, state by state, for each workflow collection. Call it at the start of a session. Pass `project` to focus on one project of the workspace (its items, plus how many are unassigned to any project); pass all_projects for the whole workspace; with neither, the project is inferred from the server's current folder, else the whole workspace is shown. The result also lists each project's in-flight and open counts and the workspace's health (doctor error and warning counts).

Arguments (* required): project all_projects

discover

read

Scan the workspace's project folder for projects (git repositories or folders with a build file) and say which are already registered in the projects collection.

Full description

Scan the workspace's project folder for projects (git repositories or folders with a build file) and say which are already registered in the projects collection. Read-only: it proposes an id, title, description, stack, repository and branch for each, and you register the ones the user confirms with add_item. Remote URLs never include credentials.

No arguments.

doctor

read

Check the workspace's files for problems and report them without changing anything.

Full description

Check the workspace's files for problems and report them without changing anything: invalid or mismatched files, items that do not fit their collection, missing parents, parent cycles, states outside a workflow, unreachable workflow states, unset secret variables (by name only), missing linked files, leftover temporary files and agent setup that cannot work (the session-start hook or MCP registration present while `keel` is not on the PATH, or a hook without the MCP server) and unfinished work whose git state is off (its branch merged but the item still open, or no commits for two weeks). Run it after an import or a manual edit.

No arguments.

draft_feedback

read

Prepare a report about a Keel problem or idea for the Keel repository and check it, entirely on this machine. It refuses text with a secret, an email address, a path from this machine or the workspace's name.

Full description

Prepare a report about a Keel problem or idea for the Keel repository and check it, entirely on this machine. It refuses text with a secret, an email address, a path from this machine or the workspace's name. It never searches or files anything: show the draft to the user, and only if they agree, give them the command it returns; that command looks for similar issues first, shows a dry run, and sends only with --submit. Describe the problem in general terms; never include project data.

Arguments (* required): title* body* label

get_context

read

Start here: learn what the workspace holds before searching or changing anything. Returns the workspace name, every collection (id, title, description, view, fields, workflow, item count) and every workflow (states and allowed moves).

No arguments.

get_history

read

Who changed what and when: the write log, newest first, optionally for one collection, one item or one actor. It holds the tool, the target and the actor, never values.

Full description

Who changed what and when: the write log, newest first, optionally for one collection, one item or one actor. It holds the tool, the target and the actor, never values. To see what changed inside an item, use git on the workspace folder (`git log -p` in the repository that holds `.keel/`).

Arguments (* required): collection id actor limit

get_item

read

Get one item by collection and id. Secret fields are shown masked.

Arguments (* required): collection* id*

get_mode

read

Get one mode: its instructions, its rules, the Keel tools it allows (a mode only ever narrows what you may do, never widens it) and its context (the items it points at, resolved and cut to a token budget so it stays small).

Full description

Get one mode: its instructions, its rules, the Keel tools it allows (a mode only ever narrows what you may do, never widens it) and its context (the items it points at, resolved and cut to a token budget so it stays small). Follow the instructions for the task the person asked for.

Arguments (* required): id* token_budget

get_schema

read

How to use the collections correctly, in one call.

Full description

How to use the collections correctly, in one call: for each collection (or the one you name) its fields with type and whether required, its states with the states each can move to, what each move requires, and a ready-to-adapt add example; plus the item properties and how each field type is given. Call it before add_item or move_item instead of guessing field names. It holds no item data.

Arguments (* required): collection

list_collections

read

List the collections: id, title, description, fields and workflow of each.

No arguments.

list_connectors

read

List the outbound connectors (Telegram chats, Cliq channels) the user has set up: each one's name, kind, the target names you may address, and whether it is ready (its secret variable is set).

Full description

List the outbound connectors (Telegram chats, Cliq channels) the user has set up: each one's name, kind, the target names you may address, and whether it is ready (its secret variable is set). Also says whether sending is off, confirm or on. Never shows a token, address or chat id.

No arguments.

list_items

read

List the items of one collection, optionally only the children of a parent, only the top-level items, or only items in given workflow states (`open`, a list such as `open,in-progress`, or a leading `!` to exclude them, such as `!done`).

Full description

List the items of one collection, optionally only the children of a parent, only the top-level items, or only items in given workflow states (`open`, a list such as `open,in-progress`, or a leading `!` to exclude them, such as `!done`). Secret fields are shown masked. Returns at most `limit` items (default 50, maximum 100) and says if more exist; when the collection has a workflow it also returns `by_state`, the number of matching items in each state (ignoring the state filter). Pass `project` to limit the result to one project of the workspace (an item belongs to a project through its project field or because its path lies inside the project's folder). Pass `fields` (for example ["title", "priority"]) to get only those, which costs far fewer tokens. Pass `where` to filter on field values, for example to find work that only a person can do or that is blocked.

Arguments (* required): collection* parent roots_only state limit project fields where

list_modes

read

List the modes (named ways of working such as plan, review, audit, dev, release) available in this workspace: id, title, one-line description, where each comes from (built-in, yours, forked) and the most it lets you do.

Full description

List the modes (named ways of working such as plan, review, audit, dev, release) available in this workspace: id, title, one-line description, where each comes from (built-in, yours, forked) and the most it lets you do. Also lists pending proposals from agents, which are not active until a person approves them. Then call get_mode for the one you need.

No arguments.

list_workflows

read

List the workflows: their states, the allowed moves between states, and the rules a move must satisfy.

No arguments.

overflow_due

read

List the entries of the now collection that are finished (Completed or Archived) and older than the retention period (the workspace's retention_days, default 90, or `days`). These are the entries `overflow` would move into the changelog.

Full description

List the entries of the now collection that are finished (Completed or Archived) and older than the retention period (the workspace's retention_days, default 90, or `days`). These are the entries `overflow` would move into the changelog. Changes nothing. The briefing says when some are due: show them to the user and ask before calling overflow.

Arguments (* required): days

setup_status

read

The setup checklist for this project: which steps are done, which are pending (with the command that does them) and which need a decision (with the question, the options and a default).

Full description

The setup checklist for this project: which steps are done, which are pending (with the command that does them) and which need a decision (with the question, the options and a default). Call it when the briefing has a `setup` line, after an upgrade, or when the user asks to set Keel up. `mode` says how to treat a decision: `ask` means put the question to the user and apply only what they choose; `auto` means the user asked you to decide, so apply the defaults and report. Read-only.

No arguments.

Write tools (18)

Change the workspace (and only the workspace), under its rules, and are logged with who called them.

add_collection

write

Create a collection: a category such as test accounts, product links or API references.

Full description

Create a collection: a category such as test accounts, product links or API references. Give it a title and a description, optionally a field list (types: text, url, path, number, date, tags, secret), a view (table, tree, cards, links), a sensitive flag and a workflow id.

Arguments (* required): id* title* description* view sensitive workflow fields

add_item

write

Add an item to a collection. In a collection with a workflow the item starts in the workflow's initial state. Fields must match the collection's field list. A secret field is given as {"secret_ref": "env:NAME"}, never as a value.

Full description

Add an item to a collection. In a collection with a workflow the item starts in the workflow's initial state. Fields must match the collection's field list. A secret field is given as {"secret_ref": "env:NAME"}, never as a value. Fails if the id already exists. Pass dry_run=true to find out whether it would succeed, and what it would produce, without writing.

Arguments (* required): collection* id* title* description* parent url path tags last_verified fields dry_run

add_note

write

Append a dated, signed progress or next-step line to an item (for example what you tried, or what to do next), so a later session resumes from it instead of re-deriving the state from git and chat.

Full description

Append a dated, signed progress or next-step line to an item (for example what you tried, or what to do next), so a later session resumes from it instead of re-deriving the state from git and chat. Notes are kept newest-last and the oldest fall off after about 4,000 characters. Not blocked by someone else's claim.

Arguments (* required): collection* id* text*

apply_setup

write

Apply a setup decision that only changes the workspace. step `projects`: track the found folders in `ids` as projects, and never suggest the folder names in `ignore` again.

Full description

Apply a setup decision that only changes the workspace. step `projects`: track the found folders in `ids` as projects, and never suggest the folder names in `ignore` again. step `mode`: set how agents treat setup decisions, `ask` or `auto`; set `auto` only when the user asked you to set things up for them. Files outside .keel (agent files, the hook, .mcp.json) are not changed here: setup_status gives their commands.

Arguments (* required): step* ids ignore choice

batch

write

Apply many add_item, update_item and move_item operations in one call, all or nothing. Use it for migrations, planning sessions and any time you would otherwise make a dozen calls in a row.

Full description

Apply many add_item, update_item and move_item operations in one call, all or nothing. Use it for migrations, planning sessions and any time you would otherwise make a dozen calls in a row. Each operation is {"op": "add_item"|"update_item"|"move_item", "arguments": {...the tool's own arguments}}. They run in order, so a later one may build on an earlier one (add a parent, then its child). Each is checked exactly as the single tool would check it; if any fails, nothing is changed and the error names the operation. Pass dry_run=true to prove the batch would succeed without writing anything. At most 200 operations.

Arguments (* required): operations* dry_run

claim_item

write

Claim an item so no one else works on it at the same time: record who holds it and until when (default four hours, at most a day).

Full description

Claim an item so no one else works on it at the same time: record who holds it and until when (default four hours, at most a day). Anyone else's update_item or move_item on it is refused, naming you and the time, until the claim runs out or you release it. Claiming again extends your own claim. Use it when you start work; release_item when you stop. The collection needs the claimed_by and claim_expires fields (the work collections have them).

Arguments (* required): collection* id* minutes force

draft_mode

write

Propose a new mode (or a change to one) when the person asks for it. The proposal is stored as a pending draft and is NOT active: only a person can approve it, in the web UI (Modes page) or with `keel modes approve`.

Full description

Propose a new mode (or a change to one) when the person asks for it. The proposal is stored as a pending draft and is NOT active: only a person can approve it, in the web UI (Modes page) or with `keel modes approve`. Tell them it is waiting. A mode can only narrow what an agent may do (tier or tools), never widen it. Describe ways of working in general terms; never put secrets or project data in it.

Arguments (* required): id* title* description* body* tier tools context rules

finish_item

write

Finish an item: write its changelog row (linked to the item, with the project, the date and the commit), walk it to its final state with every rule checked, release your claim and note the commit.

Full description

Finish an item: write its changelog row (linked to the item, with the project, the date and the commit), walk it to its final state with every rule checked, release your claim and note the commit. All or nothing: if a step is refused the changelog row is removed and the item is left as it was. Repeating it on finished work changes nothing.

Arguments (* required): collection* id* note changelog force

init_workspace

write

Create a Keel workspace in the folder this server was started in.

Full description

Create a Keel workspace in the folder this server was started in. The first call changes nothing and returns a preview of what would be created (the preset's collections, the project folders found, an optional projects root); show it to the user, and only if they agree call again with identical arguments to create it. Use it when setup_status says there is no workspace. It writes only a hidden .keel folder; it never moves or edits the user's own folders.

Arguments (* required): name preset definition_of_done projects_root

mark_verified

write

Record that a doc is up to date: sets its verified_commit to the HEAD of its project's git repository and last_verified to today. Call it after you have read what changed and updated the doc.

Full description

Record that a doc is up to date: sets its verified_commit to the HEAD of its project's git repository and last_verified to today. Call it after you have read what changed and updated the doc. The doc must belong to a project (its project field, or a path inside the project's folder) that is a git repository.

Arguments (* required): collection* id*

move_item

write

Move an item to another state of its collection's workflow, for example from in-progress to testing. Refused if the workflow does not allow the move or a rule of the move is not satisfied; the error says which rule.

Full description

Move an item to another state of its collection's workflow, for example from in-progress to testing. Refused if the workflow does not allow the move or a rule of the move is not satisfied; the error says which rule. If the move is not allowed directly, the error lists the states it can go to; pass `through` to walk several steps at once. Refused while someone else holds a live claim on the item, unless force is set. Pass dry_run=true to find out whether it would succeed, and what it would produce, without writing.

Arguments (* required): collection* id* to_state* through force dry_run

overflow

write

Move the finished entries listed by overflow_due out of the now collection into the changelog, so now does not bloat. Only Completed or Archived entries older than the retention period move; entries in any other stage never do.

Full description

Move the finished entries listed by overflow_due out of the now collection into the changelog, so now does not bloat. Only Completed or Archived entries older than the retention period move; entries in any other stage never do. Nothing is lost: each becomes a changelog row with its title, full description, date, type, project, release, plan, priority and hierarchy (an entry already named by a changelog row keeps that row). Do it only after the user agreed to the list from overflow_due. Each call is audited.

Arguments (* required): days

record_verification

write

Record the outcome of verifying an item (you ran its tests, build or lint yourself): passed or failed, with a short summary. It stores the result and the commit the code is at now on the item.

Full description

Record the outcome of verifying an item (you ran its tests, build or lint yourself): passed or failed, with a short summary. It stores the result and the commit the code is at now on the item. A workflow move that carries the require_verified rule (for example to testing or done) then needs a passing result at the current commit. This only records what you report; it never runs anything, and Keel never runs a command taken from item data through a tool. Refused while someone else holds a claim, unless force is set.

Arguments (* required): collection* id* passed* summary force

release_item

write

Give up your claim on an item so others can work on it. Only the holder can release it, unless force is set. Does nothing if the item is not claimed.

Arguments (* required): collection* id* force

render_report

write

Make a PDF report from Markdown (headings, lists, tables, code, bold and italic; raw HTML and images are not rendered) using a Chromium-based browser on this machine.

Full description

Make a PDF report from Markdown (headings, lists, tables, code, bold and italic; raw HTML and images are not rendered) using a Chromium-based browser on this machine. The file is saved as <name>.pdf in the workspace's local/reports folder; attach it to a message with send_message's `attachment`. Secret values are removed from the text. Fails with a clear message if no Chrome, Chromium, Edge or Brave is installed.

Arguments (* required): title* markdown* name

set_retention

write

Set how many days finished work (Completed or Archived entries of now) stays before it overflows into the changelog. The default is 90. Change it only when the user asks.

Arguments (* required): days*

start_item

write

Start work on an item so the next session can resume it: claim it (see claim_item), move it into its first working state, and record a branch name (suggested as keel/<collection>-<id>, or the one you give).

Full description

Start work on an item so the next session can resume it: claim it (see claim_item), move it into its first working state, and record a branch name (suggested as keel/<collection>-<id>, or the one you give). Starting work already in progress only refreshes your claim. Read the item's notes first: they say where the last session stopped. Returns the item and the suggested branch.

Arguments (* required): collection* id* branch to_state minutes force

update_item

write

Change an existing item. Only the properties you give are changed; `fields` is merged key by key. The state cannot be changed here: use move_item. A secret field is given as {"secret_ref": "env:NAME"}, never as a value.

Full description

Change an existing item. Only the properties you give are changed; `fields` is merged key by key. The state cannot be changed here: use move_item. A secret field is given as {"secret_ref": "env:NAME"}, never as a value. Refused while someone else holds a live claim on the item, unless force is set. Pass dry_run=true to find out whether it would succeed, and what it would produce, without writing.

Arguments (* required): collection* id* title description parent url path tags last_verified fields force dry_run

Outbound tools (1)

Leave the machine (messages, reports). Offered only when connectors are set up, and shown as a preview first.

send_message

outbound

Send a message through a connector the user set up (see list_connectors): Telegram, a Cliq channel or email. `to` names a chat or recipient of that connector (optional when it has only one); email also takes a `subject`.

Full description

Send a message through a connector the user set up (see list_connectors): Telegram, a Cliq channel or email. `to` names a chat or recipient of that connector (optional when it has only one); email also takes a `subject`. `attachment` is the name of a PDF made with render_report. Sending leaves this machine, so do it only when the user asked for it. In confirm mode the first call returns a preview of exactly what would be sent; show it to the user and, if they agree, call again with identical arguments to send. Secret values are removed from the text; long text is split.

Arguments (* required): connector* text* to subject attachment