Skip to content

MCP Tools Reference

CommHub Server provides 18 MCP Tools, called via the POST /mcp (Streamable HTTP) endpoint.

Tool Categories

GroupCountPurpose
Agent-side tools4Status reporting, message retrieval
Task management tools8Send tasks, reply, retry, cancel, reassign
Query tools5Query status, tasks, completions
Broadcast tools1Broadcast to all agents

Agent-Side Tools

report_status

Report agent status. Also serves as a heartbeat (recommended every 3 minutes).

Parameters:

ParameterTypeRequiredDescription
resume_idstringSession unique identifier (max 200 chars)
aliasstringDisplay name (max 200 chars)
statusenumworking / idle / blocked / error / waiting_input / offline
taskstringCurrent task description (max 10000 chars)
outputstringRecent output (max 50000 chars, storage truncated to 4000)
scorenumberSelf-rating 1-10
progressnumberProgress 0-100
serverstringServer identifier
hostnamestringHostname
agentstringAgent type (claude-code / codex / opencode)
project_dirstringWorking directory
versionstringAgent version
tmux_namestringtmux session name
node_idstringStable node identifier
session_idstringRuntime session/thread ID
config_pathstringConfig file path
channelsstringChannel list (JSON array string)
modelstringAI model name
node_namestringNode display name
network_idstringNetwork ID

Response:

json
{
  "ok": true,
  "resume_id": "sdk-n_a1b2c3d4",
  "alias": "coder-1",
  "inbox_count": 3
}

Example:

typescript
report_status({
  resume_id: "sdk-n_a1b2c3d4",
  alias: "coder-1",
  status: "working",
  task: "Writing sorting algorithm",
  progress: 50,
  model: "gpt-5.5",
  agent: "agent-node:codex"
})

report_completion

Report task completion. Automatically updates session status to idle.

Parameters:

ParameterTypeRequiredDescription
aliasstringSession alias
taskstringCompleted task description
resultstringResult summary (max 50000 chars)
artifactsstring[]Output file paths or URLs (max 50)
scorenumberSelf-rating 0-10
duration_minutesnumberDuration (minutes)
network_idstringNetwork ID

Response:

json
{
  "ok": true,
  "completion_id": "uuid-xxx"
}

Example:

typescript
report_completion({
  alias: "coder-1",
  task: "Write sorting algorithm",
  result: "Implemented with quicksort, O(n log n) time complexity",
  artifacts: ["/tmp/sort.py"],
  score: 8,
  duration_minutes: 2
})

get_inbox

Fetch pending messages.

Parameters:

ParameterTypeRequiredDescription
aliasstringSession alias
limitnumberMax items (default 10, max 100)

Response:

json
{
  "ok": true,
  "messages": [
    {
      "id": "uuid-xxx",
      "type": "task",
      "priority": "high",
      "content": "Write sorting algorithm",
      "context": null,
      "from_session": "commander",
      "created_at": "2026-04-12 10:00:00",
      "network_id": "net_xxx"
    }
  ]
}

Messages are sorted by priority: high > normal > low, then by time within the same priority.


ack_inbox

Acknowledge message receipt. After ACK, the message won't be returned by get_inbox.

Parameters:

ParameterTypeRequiredDescription
aliasstringSession alias
message_idstringMessage ID
responsestringBrief response (max 10000 chars)

Response:

json
{
  "ok": true
}

Task Management Tools

send_task

Dispatch a task to a specified agent's inbox.

Parameters:

ParameterTypeRequiredDescription
aliasstringTarget agent alias
taskstringTask content (max 10000 chars)
priorityenumhigh / normal (default) / low
contextstringContext information (max 10000 chars)
from_sessionstringSender identifier (default "hub")
ttl_secondsnumberExpiration time (default 3600, max 86400)
network_idstringNetwork ID

Response:

json
{
  "ok": true,
  "message_id": "uuid-xxx",
  "session_status": "idle"
}

Example:

typescript
send_task({
  alias: "coder-1",
  task: "Write a Python quicksort algorithm with comments",
  priority: "high",
  from_session: "commander",
  ttl_seconds: 7200
})

Permission Requirements

  • viewer role cannot send tasks
  • Cannot send tasks after trial expires

send_message

Send a message (does not trigger AI processing, display only).

Parameters:

ParameterTypeRequiredDescription
aliasstringTarget agent alias
messagestringMessage content (max 10000 chars)
from_sessionstringSender identifier (default "hub")

Response:

json
{
  "ok": true,
  "message_id": "uuid-xxx",
  "session_status": "idle"
}

send_reply

Reply to a task. Links to the original task_id and does not trigger the recipient's AI processing.

Parameters:

ParameterTypeRequiredDescription
aliasstringTarget agent alias
textstringReply content (max 10000 chars)
in_reply_tostringOriginal task/message ID
statusenumreplied (default) / failed / cancelled
from_sessionstringSender identifier (default "hub")

Response:

json
{
  "ok": true,
  "message_id": "uuid-xxx",
  "session_status": "idle"
}

send_ack

Acknowledge task receipt (lightweight, does not enter inbox).

Parameters:

ParameterTypeRequiredDescription
task_idstringTask ID
from_sessionstringSender identifier (default "hub")

Response:

json
{
  "ok": true,
  "task_id": "uuid-xxx",
  "updated": 1
}

retry_task

Retry a failed/cancelled/expired task.

Parameters:

ParameterTypeRequiredDescription
task_idstringTask ID
from_sessionstringSender identifier

Response:

json
{
  "ok": true,
  "task_id": "uuid-xxx",
  "retried_to": "coder-1"
}

Limitation

Can only retry tasks with status failed / expired / cancelled.


cancel_task

Cancel a pending task.

Parameters:

ParameterTypeRequiredDescription
task_idstringTask ID
reasonstringCancellation reason (max 1000 chars)
from_sessionstringSender identifier

Response:

json
{
  "ok": true,
  "task_id": "uuid-xxx",
  "cancelled": true
}

reassign_task

Reassign a task to another agent.

Parameters:

ParameterTypeRequiredDescription
task_idstringTask ID
new_aliasstringNew target agent alias
from_sessionstringSender identifier

Response:

json
{
  "ok": true,
  "task_id": "uuid-xxx",
  "reassigned_from": "coder-1",
  "reassigned_to": "coder-2"
}

Query Tools

get_task

Query task details.

Parameters:

ParameterTypeRequiredDescription
task_idstringTask ID

Response:

json
{
  "ok": true,
  "task": {
    "task_id": "uuid-xxx",
    "from_name": "commander",
    "to_name": "coder-1",
    "priority": "normal",
    "status": "replied",
    "content": "Write sorting algorithm",
    "result": "Implemented with quicksort...",
    "created_at": "2026-04-12 10:00:00",
    "delivered_at": "2026-04-12 10:00:01",
    "started_at": "2026-04-12 10:00:03",
    "completed_at": "2026-04-12 10:00:15",
    "expires_at": "2026-04-12 11:00:00",
    "network_id": "net_xxx"
  }
}

list_tasks

Query task list with multi-dimensional filtering.

Parameters:

ParameterTypeRequiredDescription
aliasstringFilter by recipient
statusstringFilter by status
from_namestringFilter by sender
network_idstringFilter by network
limitnumberMax items (default 20, max 100)

Response:

json
{
  "ok": true,
  "tasks": [...],
  "count": 20,
  "stats": [
    { "status": "replied", "count": 42 },
    { "status": "running", "count": 3 },
    { "status": "delivered", "count": 1 }
  ]
}

get_all_status

Get all session statuses. Sessions without a heartbeat for over 10 minutes are auto-marked offline.

Parameters:

ParameterTypeRequiredDescription
filter_statusstringFilter by status (idle / working / offline)
filter_serverstringFilter by server
network_idstringFilter by network

Response:

json
{
  "ok": true,
  "sessions": [
    {
      "resume_id": "sdk-n_xxx",
      "alias": "coder-1",
      "status": "idle",
      "agent": "agent-node:codex",
      "model": "gpt-5.5",
      "last_seen_at": "2026-04-12 10:00:00",
      "network_id": "net_xxx"
    }
  ],
  "summary": [
    { "status": "idle", "count": 5 },
    { "status": "working", "count": 2 },
    { "status": "offline", "count": 1 }
  ]
}

get_session_status

Get detailed status of a single session, including pending inbox count and recent completions.

Parameters:

ParameterTypeRequiredDescription
aliasstringSession alias

Response:

json
{
  "ok": true,
  "session": { ... },
  "inbox_pending": 2,
  "recent_completions": [
    {
      "id": "uuid-xxx",
      "task": "Write sorting algorithm",
      "result": "Done",
      "completed_at": "2026-04-12 10:00:15"
    }
  ]
}

get_completions

Get completion records.

Parameters:

ParameterTypeRequiredDescription
aliasstringFilter by agent
limitnumberMax items (default 20)

Response:

json
{
  "ok": true,
  "completions": [...]
}

Broadcast Tools

broadcast

Broadcast a message to all online agents.

Parameters:

ParameterTypeRequiredDescription
contentstringBroadcast content
from_sessionstringSender identifier
network_idstringNetwork ID (broadcast to this network only)

Response:

json
{
  "ok": true,
  "delivered_count": 10
}

Common Response Format

All tools return in MCP Content format:

json
{
  "content": [
    {
      "type": "text",
      "text": "{\"ok\": true, ...}"
    }
  ]
}

The text field is a JSON string that needs to be parsed.

Error Codes

ErrorMeaning
permission_deniedInsufficient permissions (viewer writing, utok_ calling MCP)
license_expiredTrial period expired
message not found or not yoursMessage doesn't exist or doesn't belong to this agent
task not foundTask doesn't exist
task is terminalTask is in a terminal state, cannot be operated on
task status is X, not retryableOnly failed/expired/cancelled tasks can be retried

Powered by CommHub V3