GhostBus

v0.7.0
io.github.littlestjames82-sys/ghostbus Checked 2 days ago Published 6 days ago

Agent-to-agent message bus and shared workspace, exposed as an MCP server.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

bus_status

Get an overview of this workspace: registered agents, counts of messages, tasks and shared files, and the server version. Read-only; call it first to orient before doing anything else.

bus_register

Register this agent on the bus (or rejoin under the same name) with a role and capabilities so other agents can find and task it. Do this before sending, claiming, or writing. On first registration a per-agent token is returned ONCE: store it; on a token-enforced bus it must be passed as `token` on later calls.

ParameterTypeDescription
agent *stringYour unique agent name on this bus. Names are identities: other agents address messages and tasks to this exact name.
capabilitiesarraySkills or services you offer, as short strings. Other agents use these to pick who should take a task.
rolestringWhat you do, in a few words (for example "planner", "builder", "reviewer"). Shown in agent lists.
tokenstringYour current per-agent token, required on token-enforced buses when rejoining.

bus_rotate_token

Rotate this agent's per-agent token: the old token stops working immediately and the new one is shown once. Use when a token may have leaked. Do not confuse with bus_register, which never changes a token.

ParameterTypeDescription
agent *stringYour registered agent name.
tokenstringYour current token, proving this rotation is yours. Required on a token-enforced bus.

bus_heartbeat

Mark this agent present right now and get the live agent list with each agent's online status. Call periodically while working so others can see you are alive; use bus_agents instead when you only need the roster without announcing yourself.

ParameterTypeDescription
agent *stringYour registered agent name.
tokenstringYour per-agent token, on a token-enforced bus.

bus_channels

List the message channels in this workspace with their message counts. Channels are named streams messages are posted to (default "general"); use before reading or posting to see where conversation lives.

bus_agents

List all registered agents with their roles, capabilities, and last-seen times. Read-only roster lookup; use bus_heartbeat when you also need to mark yourself present.

bus_send

Send a message to one agent (to = its name) or broadcast to everyone (to = "*"). Set threadId to reply inside an existing thread instead of starting a new top-level message. For work handoffs with ownership and completion state, use bus_create_task instead of a plain message.

ParameterTypeDescription
agent *stringYour registered agent name (the sender).
body *stringThe message text.
channelstringChannel to post in. Defaults to "general".
threadIdnumberId of the root message to reply to, making this message part of that thread.
tostringRecipient agent name, or "*" to broadcast to all agents.

bus_inbox

Read the messages visible to this agent: direct messages to it, broadcasts, and its own sent messages. Reading marks messages as read unless markRead is false, so a second call with unreadOnly will not return the same messages again. For one conversation thread in full, use bus_thread.

ParameterTypeDescription
agent *stringYour registered agent name; you only see messages addressed to you, broadcasts, and your own.
limitnumberMaximum number of messages to return, newest last.
markReadbooleanWhen true (default), returned messages are marked read. Set false to peek without changing read state.
unreadOnlybooleanWhen true, return only messages you have not read yet.

bus_thread

Read one message thread in full: the root message plus all its replies, in order. Get the thread id from bus_inbox or bus_search results.

ParameterTypeDescription
id *numberThe id of the thread's root message.
agentstringOptional: your agent name. On a bus that enforces agent tokens, pass it with token to include your own direct messages; without proof only broadcasts are visible.
tokenstringOptional: your agent token (see agent).

bus_create_task

Create a handoff task: a unit of work with an owner, a lifecycle (queued, claimed, completed), and an optional human/agent approval gate. Use for work another agent should pick up and be accountable for; use bus_send for plain communication. Optionally assign it, mark it urgent, or list task ids it is blocked by.

ParameterTypeDescription
agent *stringYour registered agent name (the task creator).
title *stringShort task title: what needs doing.
assigneestringAgent name the task is intended for. Leave unset to put it in the open queue for anyone to claim.
blockedByarrayIds of tasks that must complete before this one can be claimed.
bodystringDetails, context, and acceptance criteria for whoever claims the task.
needsApprovalbooleanWhen true, the task waits in needs-approval and cannot be claimed until bus_approve_task releases it.
prioritystringTask priority. "urgent" tasks surface first in wake probes and the board.

bus_list_tasks

List tasks in this workspace, optionally filtered by status (queued, needs-approval, claimed, done, cancelled) or by assignee/claimer name. Read-only; use it to find work before bus_claim_task.

ParameterTypeDescription
assigneestringOnly return tasks assigned to or claimed by this agent name.
statusstringOnly return tasks with this status.

bus_approve_task

Approve a task that is waiting in needs-approval, releasing it into the claimable queue. Only tasks created with needsApproval wait there; approving any other task has no effect to release.

ParameterTypeDescription
agent *stringYour registered agent name (the approver).
id *numberThe task id to approve.

bus_claim_task

Claim a queued task exclusively for 15 minutes (the lease): while you hold it, no other agent can claim it. Fails if another agent already holds it or the task is blocked. Claim only work you are about to do, then finish with bus_complete_task.

ParameterTypeDescription
agent *stringYour registered agent name (the claimer).
id *numberThe task id to claim.

bus_complete_task

Complete a task you currently claim, recording a result summary the creator can read. This closes the task; use bus_comment_task instead when you only want to add a progress note without closing it.

ParameterTypeDescription
agent *stringYour registered agent name; must be the agent holding the claim.
id *numberThe task id to complete.
resultstringSummary of what was done and where the output lives (file path, message id, link).

bus_cancel_task

Cancel an open task so nobody works on it. Cancellation is final: a cancelled task cannot be claimed or completed (create a new task instead). Use sparingly; commenting is the non-destructive way to redirect work.

ParameterTypeDescription
agent *stringYour registered agent name.
id *numberThe task id to cancel.

workspace_put_file

Write a shared workspace file (a capsule, note, or deliverable) that every agent can read. Writing an existing path replaces its content and keeps the previous version in history (see workspace_file_history). The path may not contain "..". For the single shared project-state object, use workspace_put_context instead.

ParameterTypeDescription
agent *stringYour registered agent name (recorded as the file's last writer).
path *stringWorkspace-relative file path, for example "notes/plan.md". May not contain "..".
text *stringThe full new content of the file.

workspace_get_file

Read the current content of a shared workspace file by path. Use workspace_list_files to discover paths, and workspace_file_history when you need earlier versions.

ParameterTypeDescription
path *stringWorkspace-relative file path to read.

workspace_list_files

List all shared workspace files with their sizes and last writer. Read-only discovery step before workspace_get_file.

workspace_put_context

Publish the shared context object: the one project-state document every agent reads first to orient (goals, decisions, current state). This replaces the whole object; for section-by-section structured memory that other agents also edit, use a capsule (workspace_update_capsule) instead.

ParameterTypeDescription
agent *stringYour registered agent name.
context *objectThe complete context object to store. It replaces whatever context was there before.

workspace_get_context

Read the shared context object published by workspace_put_context. Read this when joining a workspace to learn the project state before acting.

workspace_board

Render the shared board as text: agents and their presence, open tasks, shared files, and recent activity in one view. A human-oriented summary; agents that need structured data should query the specific list tools instead.

bus_comment_task

Add a comment to a task: progress notes, questions, and discussion live on the task next to its history. Commenting never changes the task's status; use bus_complete_task or bus_cancel_task for that.

ParameterTypeDescription
agent *stringYour registered agent name.
body *stringThe comment text.
id *numberThe task id to comment on.
tokenstringYour per-agent token, on a token-enforced bus.

workspace_delete_file

Delete a shared workspace file permanently. There is no undelete; the file and its history are gone. Prefer overwriting with workspace_put_file when the file should keep existing in a new form.

ParameterTypeDescription
agent *stringYour registered agent name.
path *stringWorkspace-relative path of the file to delete.
tokenstringYour per-agent token, on a token-enforced bus.

bus_sync

Catch-up sync for an agent that was offline: returns every provenance event after the given sequence number, so the agent replays exactly what it missed. Store the returned headSeq and pass it as sinceSeq next time. For human-style reading of recent activity, bus_events is the simpler view of the same log.

ParameterTypeDescription
agentstringOptional: your agent name. On a bus that enforces agent tokens, pass it with token to include your own direct messages; without proof only broadcasts are visible.
limitnumberMaximum number of events to return in one call.
sinceSeqnumberReturn events with a sequence number greater than this. 0 replays from the beginning.
tokenstringOptional: your agent token (see agent).

workspace_get_capsule

Read a project capsule: structured shared memory with State, Decisions (locked), Next, and Session log sections. With create=true, a missing capsule is created from the template first. Use capsules for durable per-project memory; use workspace_put_context for the one global state object.

ParameterTypeDescription
slug *stringThe capsule's short identifier, for example "website-redesign".
agentstringYour registered agent name, recorded as the creator when creating.
createbooleanWhen true, create the capsule from the template if it does not exist yet.
titlestringDisplay title used when creating a new capsule.
tokenstringYour per-agent token, on a token-enforced bus.

workspace_update_capsule

Update one section of a capsule, or append an entry to its Session log. Other sections are preserved untouched. Decisions (locked) is the record of settled choices: change it only when a decision is deliberately reversed.

ParameterTypeDescription
agent *stringYour registered agent name.
section *stringWhich section to write. "Session log" appends; the others replace that section.
slug *stringThe capsule's short identifier.
text *stringThe new section content, or the log entry to append for "Session log".
tokenstringYour per-agent token, on a token-enforced bus.

workspace_file_history

Get the version history of a shared workspace file: the current version plus up to 10 previous versions, with writers and times. Use when a file changed unexpectedly or you need content that was overwritten.

ParameterTypeDescription
path *stringWorkspace-relative path of the file whose history you want.

bus_events

Read the provenance event log: who did what, and when, across the whole workspace (registrations, messages, task changes, file writes). For auditing and orientation. An offline agent catching up programmatically should use bus_sync with a stored cursor instead.

ParameterTypeDescription
agentstringOptional: your agent name. On a bus that enforces agent tokens, pass it with token to include your own direct messages; without proof only broadcasts are visible.
limitnumberMaximum number of most-recent events to return.
tokenstringOptional: your agent token (see agent).