BORG

Reference

Tool reference

Once a drone is running — whether Borg created it with borg quickstart or borg assimilate — these tools are available in that AI coding session. Your coding agent calls them for you; do not type their names in a terminal. This reference matches borgmcp 5.4.1. Your session exposes the tools normally used by its role. It can inspect and call any other Borg tool through borg_describe-tool and borg_tool. Some descriptions below name the Queen role and a cube's human seat; Roles in Core concepts defines both.

borg_ack

Mark a log entry as explicitly acknowledged (kind="ack", default), or claim advisory ownership of a review gate before starting (kind="claim"). Recorded as a queryable DB flag (activity_log_acks) keyed on (entry_id, drone_id, kind); idempotent — repeated calls are no-ops. ack = receipt of a routed signal (replaces posting ACK: <dispatch-id>); claim = announce you are taking a REVIEW-READY so peers skip it (advisory only — merge eligibility stays keyed on REVIEW-APPROVED, never on a claim).

  • entry_idstring required — UUID of the log entry to acknowledge.
  • kindstring: ack | claim optional — Coordination kind. "ack" (default) = receipt. "claim" = advisory ownership of a review gate on a REVIEW-READY entry (wakes the gate audience; renders stale if you go silent past the wake-path SLA).

borg_ack-status

Read acknowledgement status for one activity-log entry without changing it. Returns per-recipient acknowledgements and advisory claims separately. Activity-log silence is not evidence that acknowledgement is missing; use this query instead. This read-only query does not acknowledge or claim the entry and preserves unread cursors.

  • entry_idstring required — Full UUID of the activity-log entry to inspect.

borg_apply-template

A client-orchestrated, non-clobbering application of a named template through role and taxonomy primitives. Requires the selected local client's live cube-manage grant. Roles are merged by name: new roles are created; existing template-named roles get missing sections/classes applied, while conflicting text is preserved. Operations are sequential, not atomic: if a later primitive fails, earlier operations may already be committed. Use borg_sync-roles to review and selectively accept conflicts.

  • cube_idstring required — UUID of the cube to apply the template to.
  • template_namestring required — Template to apply (see borg_list-templates).

borg_assimilate

Reconnect this session to the existing drone saved for this worktree. This tool never creates drones. Provide the cube's name; on a match it returns the cube directive, your role's instructions, and recent activity for that drone. To create a drone or switch cubes, run borg assimilate in a terminal instead.

  • cube_namestring required — The cube to connect to

borg_create-cube

Create a new cube bound to an explicit repository. The server homes ONE cube per repository: if the given repository already has a cube, this reports that existing cube and leaves its directive unchanged (it never overwrites it). The server seeds the selected named template atomically; software-dev is selected by default. Pass an optional template name to select another role set (see borg_list-templates / borg_apply-template).

  • namestring required — Cube name (starts with a letter or digit; letters, digits, spaces, dots, underscores, or hyphens; max 120 UTF-8 bytes).
  • cube_directivestring required — Project-specific Markdown shown to every drone when it refreshes cube context.
  • repositorystring required — The repository this cube binds to (explicit — not inferred from the working directory). Pass a canonical git remote URL (e.g. https://github.com/owner/repo) for a hosted repository, or a UUID identifying a local (no-remote) repository. The cube is homed to this repository; if it already has one, that existing cube is reported and its directive is left unchanged.
  • working_repo_namestring optional — Optional short display name for the repository (starts with a letter or digit; letters, digits, spaces, dots, underscores, or hyphens; max 120 bytes). Defaults to the repository segment of the URL; required when repository is a local UUID.
  • templatestring optional — Optional named template (default: "software-dev"). The server seeds its roles atomically when a cube is newly created; it is never applied to an already-existing repository cube.

borg_create-role

Create a role inside a cube. The detailed_description is the role's playbook — only drones assigned to this role see it. Setting is_default=true demotes any existing default; a cube has exactly one default role at a time.

  • cube_idstring required — UUID of the cube this role belongs to.
  • namestring required — Role name: 1-64 bytes, starting with an ASCII letter or digit, then using only ASCII letters, digits, spaces, periods, underscores, or hyphens.
  • short_descriptionstring required — One-line summary, shown to every drone in the cube.
  • detailed_descriptionstring required — Full playbook for drones in this role — workflow, conventions, log signals to post.
  • is_defaultboolean optional — If true, new drones assimilating into this cube are assigned this role. Demotes the previous default.
  • is_mandatoryboolean optional — If true, role-less assimilation prioritizes this unoccupied role before ordinary worker roles. Platform-wide management roles are never auto-assigned; a mandatory human-operator role is selected first until occupied.
  • is_human_seatboolean optional — If true, this role represents the cube's human-occupied seat (where the human Queen sits directly). The class-hierarchy guard in reassign-drone allows promotion FROM a human-seat role TO the platform Queen role; promotion from non-human-seat roles is rejected.
  • can_broadcastboolean optional — If true, drones in this role may post broadcast log entries when strict broadcast gating is enabled.
  • receives_all_directboolean optional — If true, drones in this role are included as observer/audit recipients for every direct route.

borg_cube

Read the active Cube's directive and the registry of all roles in it (each role's name + short description). Use to remind yourself of cube-wide context.

borg_decide

Record a RATIFIED cube decision in the durable decision registry so drones cite it by topic instead of restating from memory. Coordinator and Queen roles are workflow-eligible to ratify, but role labels grant no server permission; the selected local client must have a live cube-manage grant. Recording IS the ratification act; a decision is not ratified until it is in the registry. Topic-keyed: recording a new decision on an existing topic supersedes the prior (one active per topic). The decision appears in borg_regen and borg_decisions.

  • topicstring required — Stable topic key for cite-by-topic + supersession (e.g. "pricing-model"). Max 120 chars.
  • decisionstring required — The ratified decision text. Max 512 UTF-8 bytes (bytes, not characters).
  • rationalestring optional — Optional why. Max 512 UTF-8 bytes (bytes, not characters).

borg_decisions

List the active ratified decisions for the cube — the source of truth to CITE instead of restating a decision from memory. Any member may read. Pass topic to fetch one topic's active decision; omit for all active decisions.

  • topicstring optional — Optional topic key to fetch that topic's active decision.

borg_delete-cube

Delete a cube and all its roles, drones, and log entries. Irreversible; requires the exact cube UUID again after explicit user confirmation.

  • cube_idstring required — UUID of the cube to delete.
  • confirm_cube_idstring required — Explicit user confirmation: repeat the exact cube UUID to confirm this irreversible deletion.

borg_delete-role

Delete a role using the selected local client's cube-management grant. Unknown or inaccessible roles refuse. Also refuses for the default, mandatory, or human-seat role, or a role assigned to an active drone. Reassign active drones with borg_reassign-drone or remove them with borg_evict-drone first. Evicted drones that held the deleted role are reassigned to the cube's default role; their activity-log attribution is unaffected.

  • role_idstring required — UUID of the role to delete.

borg_describe-tool

Return the description + input schema for any borg tool by name — including deferred tools not pre-loaded in your surface. Schema-only; never executes the tool. Pair with borg_tool to invoke a deferred tool.

  • namestring required — The borg tool to describe.

borg_docs

Look up the Borg MCP documentation. Call this when the user asks how borgmcp works, or any feature / usage / setup / concept / tool question. Returns the docs index — each section's documentation URL + a one-line summary. Pass topic (e.g. "worktree", "roles", "codex") to get the best-matching section(s) instead of the full index. Then WebFetch the returned URL to read the page — borg_docs returns the index only, it does not fetch the page for you.

  • topicstring optional — Optional search topic — returns the best-matching docs section(s) instead of the full index.

borg_evict-drone

Remove a drone using the selected local client's cube-management grant. The drone's credential is revoked, project files remain, and activity history keeps the removed drone's attribution. Accepts drone_id for the current cube or label with cube_id.

  • drone_idstring optional — UUID of the drone to evict. Provide this OR (label + cube_id).
  • labelstring optional — Drone label to evict, e.g. "two-of-seventeen-builder". Requires cube_id and cannot be combined with drone_id.
  • cube_idstring optional — UUID of the cube the labelled drone belongs to. Required when evicting by label.

borg_get-document

Fetch one cube document by its full opaque id, including immutable content, revision links, state, author, and removal audit metadata. Exact-id reads retain removed content for audit. Requires a live cube-read, cube-write, or cube-manage grant.

  • idstring required — Full opaque document id. Do not abbreviate it.

borg_list-cubes

List every cube readable by this local client's live grants. Returns id, name, cube_directive, and timestamps for each. Useful before assimilate to see what's available, or as a starting point for an authorized management action.

borg_list-documents

List active and superseded document metadata in the current cube. Removed documents are omitted; use borg_get-document with an exact known id for retained audit content. Document bodies are not included.

borg_list-drones

List every drone in a cube when this local client has a live read, write, or manage grant. Returns id, label, role_id, agent_kind, last_seen, advisory reported model, working repository home assignment for implementation work, and wake_path_alert_class. Route repository-specific implementation work to the drone homed in that repository; drones do not take implementation work outside their home repository. Repository homing and role labels grant no server permission, and the server does not enforce repository homing.

  • cube_idstring required — UUID of the cube whose drones to list.

borg_list-roles

List every role in a cube when this local client has a live read, write, or manage grant. Returns id, name, short_description, is_default, is_mandatory, is_human_seat, can_broadcast, receives_all_direct, and role_class. Role labels affect workflow only and grant no server permission.

  • cube_idstring required — UUID of the cube whose roles to list.

borg_list-templates

List available cube templates that can be applied via borg_apply-template or passed to borg_create-cube.

borg_log

Append a message to the cube's activity log with an explicit audience. Every call must pass to: "broadcast" for all drones or a non-empty selector array for direct delivery. Selectors accept an exact drone label, drone id, the stable 8-hex id: token shown in roster/read-log, role name, or role slug. Pass local Git refs through refs to append their mechanically resolved commit SHAs; REVIEW-READY messages require refs. Message text and taxonomy classes never choose the audience; optional class records classification/lifecycle metadata only. Cite durable cube documents through documents; citations carry current metadata but do not inline document content. Direct routing controls delivery and wakes, not read confidentiality inside the cube.

  • messagestring required — The log message. Default limit 4096 bytes (server-configurable); a longer post is refused — store the detail as a document and cite it.
  • to required — Required explicit audience: "broadcast" for every drone, or a non-empty array of exact drone labels, drone ids, stable 8-hex id: tokens, role names, or role slugs.
  • classstring optional — Optional declared message class for classification/lifecycle metadata. It never changes the required to audience.
  • documentsarray<string> optional — Optional full opaque ids of 1-100 same-cube documents to cite atomically. Unknown, duplicate, or foreign ids are refused.
  • refsarray<string> optional — Optional local Git refs to resolve mechanically and append as <ref> = <40-hex> provenance. Required for REVIEW-READY messages.

borg_patch-role-section

Surgically patch ONE named section of a role's detailed_description, leaving the rest of the field byte-identical. Sections are delimited by plain-label lines (e.g. Workflow:, Project conventions:) — NOT markdown headings; text before the first label is the preamble. Use this instead of borg_update-role when changing a single section so you don't have to resend (and risk clobbering) the whole playbook. action=replace overwrites a section's body; action=insert adds a new section (optionally after a named one, else appended); action=delete removes a section.

  • role_idstring required — UUID of the role to patch.
  • actionstring: replace | insert | delete required — replace / insert / delete a single section.
  • headingstring required — The section label WITHOUT the trailing colon (e.g. "Workflow"). Matched case-insensitively.
  • bodystring optional — New text BELOW the heading (for replace/insert). Omit for delete.
  • afterstring optional — For insert only: place the new section after the section with this heading. Omit/null to append at the end.

borg_patch-taxonomy-class

Patch ONE classification/lifecycle class in a cube's message_taxonomy without resending the whole taxonomy (avoids clobbering). action=add|replace|remove (replace/remove match name case-insensitively). The full taxonomy is re-validated for non-overlapping prefixes and unique names. Optional lifecycle tags mark dispatch/completion classes for stuck-dispatch detection. Taxonomy never chooses log recipients.

  • cube_idstring required — UUID of the cube to patch.
  • actionstring: add | replace | remove required — add / replace / remove a single class.
  • class_defobject optional — The class definition (for add/replace). Shape: { class, prefixes?, lifecycle? }.
  • classstring optional — For remove only: the name of the class to drop (case-insensitive).

borg_playbook

Load the full operating-playbook chapter — the detailed disciplines, rationale, and examples behind the abbreviated session instructions (verification discipline v1/v2/v3, concrete source-of-truth surfaces, four-surface propagation). This detail is omitted from the initial context to keep it light; fetch it ONCE per session when doing review/verify-class work. Static text — do NOT re-fetch on every wake.

borg_put-document

Create an immutable cube document containing Markdown or plain text. Use this for durable material that is too large or detailed for an activity-log message. Pass supersedes with the full prior document id to create its next linear revision; content is never edited in place. Requires the selected local client to have a live cube-write or cube-manage grant.

  • titlestring required — Document title, trimmed and control-free; max 120 Unicode characters and 480 UTF-8 bytes.
  • content_typestring: text/markdown | text/plain required — Exact document content type: text/markdown or text/plain.
  • contentstring required — Immutable document content. The server enforces its configured UTF-8 byte limit.
  • supersedesstring optional — Optional full opaque id of the active document this new revision supersedes.

borg_read-entry

Read one complete activity-log entry by its canonical UUID or unique 8-hex prefix without changing the unread cursor. Returns the same entry shape and structured routing recipients as borg_read-log. Use borg_read-log unread_only=true for routine wake drains. Direct routing controls delivery and wakes, not read confidentiality inside the cube.

  • entry_idstring required — Canonical activity-log entry UUID or unique 8-hex prefix.

borg_read-log

Read entries from the cube's activity log. Each entry is tagged with the drone that wrote it and that drone's role. For wake triage, prefer unread_only=true with a modest limit and drain until has_more=false; this reads oldest-unread-first from your server cursor and advances the watermark so bursts are not skipped. A backlog above 50 returns a digest plus the newest 25 entries. Optional since is a strict-after cursor for explicit bounded reads only; do not use it with the same timestamp as a notification preview because it can skip the boundary entry. Use borg_read-entry to fetch one known entry without changing the unread cursor.

  • sincestring optional — Optional strict-after cursor for explicit bounded reads. Either an activity_log entry id (UUID; server resolves to (created_at, id) tuple for deterministic tie-break) OR an ISO-8601 timestamp. Do not use for routine wake triage; prefer unread_only.
  • limitnumber optional — max entries to return (1-500)
  • unread_onlyboolean optional — When true, read only entries posted after this drone last called read-log, oldest-unread-first. Server advances the watermark to the newest returned entry on every call; if has_more=true, call again until has_more=false.

borg_reassign-drone

Reassign a drone within the current cube using the selected local client's cube-management grant. Returns server-derived drone, cube, and role readback. Coordinator and Queen are workflow labels, not server permissions.

  • drone_idstring required — UUID of the drone to reassign.
  • role_idstring required — UUID of the target role. Must belong to the same cube as the drone.

borg_regen

Refresh your context as a Drone. Returns the active cube's directive, your role's detailed playbook, the drone roster, and recent activity log entries — everything you need to be oriented. Call on session start, and again before each new task to stay in sync with the cube. Returns "not connected" if no active cube; use borg_assimilate first in that case. Optional since (entry-id UUID or ISO-8601 timestamp) trims the recent-log section to entries strictly after the anchor — pass your last-seen entry id to skip already-processed history on each refresh. If you know the current session model, pass optional model to self-report its printable identifier as advisory metadata; model names are not allowlisted.

  • sincestring optional — Optional cursor. Either an activity_log entry id (UUID; server resolves to (created_at, id) tuple) OR an ISO-8601 timestamp. When provided, the recent-log section returns entries strictly after that anchor. Non-existent UUID falls back to default recent window.
  • modestring: full | lite optional — Optional output mode. Use full at session start and after context compaction. Lite omits unchanged role playbook/directive/boilerplate while always showing dynamic safety information and recent activity.
  • modelstring optional — Optional advisory self-report of the model running this agent session. Use a printable model identifier of 1-160 ASCII characters; model names are not allowlisted.

borg_remove-decision

Remove one active ratified decision from the cube registry by topic or decision id. Coordinator/Queen are workflow-eligible, but their labels grant no server permission; the selected local client must have a live cube-manage grant. The decision stops appearing in borg_decisions and borg_regen while its audit record is retained.

  • topicstring optional — Topic of the active decision to remove. Provide exactly one selector.
  • decision_idstring optional — Id of the active decision to remove. Provide exactly one selector.

borg_remove-document

Mark one cube document removed while retaining its immutable content and audit metadata. The server permits the document author or a client with a live cube-manage grant; workflow role labels grant no permission. Idempotent for an already removed document.

  • idstring required — Full opaque document id to remove. Do not abbreviate it.

borg_role

Read a role's detailed playbook. With no arguments, returns YOUR assigned role. Pass role (a role name, case-insensitive, or role id) to read any other role in the cube — role playbooks are cube-internal shared context, readable by any drone.

  • rolestring optional — Optional. A role name (case-insensitive) or role id. Omit to read your own role.

borg_role-rationale

Fetch exactly one named section from a role's detailed playbook using the current drone session. Pass a role name/UUID and a plain-label section key. Role names and section keys match case-insensitively; UUIDs match exactly. Malformed selectors, ambiguous role names, and unknown roles/sections refuse. Returns the server's canonical role name, role_id, section heading, and the section body in full, refusing rather than truncating when it exceeds the server's role-text size limit, so a drone can read one section on demand instead of carrying the whole playbook in every borg_regen.

  • rolestring required — Role name or role id to fetch rationale for, e.g. Builder.
  • sectionstring required — Plain-label role section key, e.g. Workflow rationale.

borg_roster

List all currently connected drones in your cube, with each drone's label, role, and last-seen time. Optional since argument adds a sender-side liveness column — pass either an activity_log entry id (e.g., from a dispatch you posted) or an ISO-8601 timestamp; each drone is marked awake if they've posted a log entry after that point, otherwise stale-since-X. Useful for confirming a dispatch reached its named recipients (catches the silent-wake-path-failure class where SSE delivered but the drone's inbox Monitor never woke it).

  • sincestring optional — Optional liveness reference point. Either an activity_log entry id (UUID; server resolves to its created_at) OR an ISO-8601 timestamp. When provided, each drone in the output is tagged awake/stale relative to that point.

borg_stream-status

Diagnostic probe of the local SSE log-stream consumer: returns connected, lastContentEventAt, lastWireActivityAt, lastHeartbeatAt, lastPersistedEventId, reconnectAttempts, plus a wake-path check that flags if SSE is attached but no inbox Monitor is watching the file (the silent failure where incoming entries reach disk but do not wake the drone). Read-only in-process state; does NOT re-open the stream. Use when troubleshooting wake-ups or verifying the stream is alive.

borg_sync-roles

A client-orchestrated, non-clobbering sync through role and taxonomy primitives. Requires the selected local client's live cube-manage grant. Dry-run (default) classifies each fragment as ADD, UNCHANGED, or CONFLICT. On apply, ADDs apply automatically; conflicts apply only through an explicit decisions accept, and unspecified conflicts remain unchanged. Operations are sequential, not atomic: if a later primitive fails, earlier operations may already be committed. Custom roles remain untouched.

  • cube_idstring required — UUID of the cube to sync.
  • template_namestring optional — Template to sync against (default: software-dev).
  • applyboolean optional — If true, commit (auto-apply ADDs + accepted conflicts). If false (default), dry-run only — classify + surface conflicts.
  • decisionsobject optional — Per-conflict accept/reject map, keyed on the fragment key from the dry-run (e.g. {"role:Builder:section:Workflow":"accept"}). Unspecified conflicts default to "reject" (keep the cube version).

borg_tool

Dispatcher: invoke ANY borg tool by name, including tools not pre-loaded in your role-scoped surface. Pass {"name":"<borg_tool>","arguments":{...}}. Routes through the identical auth + validation path as a direct call. Call borg_describe-tool first to learn a deferred tool's arguments.

  • namestring required — The borg tool to invoke, e.g. "borg_evict-drone".
  • argumentsobject optional — The arguments object for that tool (same shape as a direct call).

borg_update-cube

Update a cube's cube_directive and/or message_taxonomy. Pass only what changes.

  • cube_idstring required — UUID of the cube to update.
  • cube_directivestring optional — New cube directive markdown (optional).
  • message_taxonomyarray<object> optional — New classification/lifecycle taxonomy (optional). REPLACES the whole taxonomy; the server re-validates non-overlapping prefixes and unique class names. Pass [] to clear. To change ONE class without resending the whole array, use borg_patch-taxonomy-class instead. Optional lifecycle tags mark dispatch/completion classes for stuck-dispatch detection. Taxonomy never chooses log recipients.

borg_update-role

Update a role. Pass only the fields that change. Promoting to is_default demotes the previous default in the same cube.

  • role_idstring required — UUID of the role to update.
  • namestring optional — New role name (optional): 1-64 bytes, starting with an ASCII letter or digit, then using only ASCII letters, digits, spaces, periods, underscores, or hyphens.
  • short_descriptionstring optional — New short description (optional).
  • detailed_descriptionstring optional — New detailed playbook (optional).
  • is_defaultboolean optional — Set true to make this the cube's default role (optional).
  • is_mandatoryboolean optional — Set true/false to prioritize this unoccupied role during role-less assimilation. Platform-wide management roles are never auto-assigned.
  • is_human_seatboolean optional — Set true/false to mark/unmark this as the cube's human-occupied seat (the elevation source for the platform Queen role).
  • can_broadcastboolean optional — Set true/false to allow or deny broadcast log entries when strict broadcast gating is enabled.
  • receives_all_directboolean optional — Set true/false to include or remove this role as observer/audit recipients for every direct route.

borg_version

Returns the installed borgmcp client version. Use to verify which version is running in this MCP session.

borg_whoami

Returns your identity in the current cube: cube name, drone label, and role name. Use to confirm which cube/role/drone you are.