You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`thread_create`|`topic`| Create a new conversation thread. Returns `thread_id`. |
528
+
|`thread_create`|`topic`| Create a new conversation thread. Optional `template` to apply defaults (system prompt, metadata). Returns `thread_id`. |
529
529
|`thread_list`| — | List threads. Optional `status` filter. |
530
530
|`thread_get`|`thread_id`| Get full details of one thread. |
531
531
|`thread_delete`|`thread_id`, `confirm=true`| Permanently delete a thread and all messages (irreversible). |
532
532
533
533
> **Note**: Thread state management (`set_state`, `close`, `archive`) are available via **REST API** (`/api/threads/{id}/state`, `/api/threads/{id}/close`, `/api/threads/{id}/archive`), not MCP tools.
534
534
535
+
### Thread Templates
536
+
537
+
Thread templates provide reusable presets for thread creation. Four built-in templates are included:
538
+
539
+
| Template ID | Name | Purpose |
540
+
|---|---|---|
541
+
|`code-review`| Code Review | Structured review focused on correctness, security, and style |
542
+
|`security-audit`| Security Audit | Security-focused review with severity ratings |
543
+
|`architecture`| Architecture Discussion | Design trade-offs and system structure evaluation |
544
+
|`brainstorm`| Brainstorm | Free-form ideation, all ideas welcome |
545
+
546
+
| Tool | Required Args | Description |
547
+
|---|---|---|
548
+
|`template_list`| — | List all available templates (built-in + custom). |
549
+
|`template_get`|`template_id`| Get details of a specific template. |
{ "topic": "My Review Session", "template": "code-review" }
556
+
```
557
+
558
+
The template's `system_prompt` and `default_metadata` are applied as defaults. Any caller-provided values override the template defaults.
559
+
535
560
### Messaging
536
561
537
562
| Tool | Required Args | Description |
538
563
|---|---|---|
539
-
|`msg_post`|`thread_id`, `author`, `content`| Post a message. Returns `{msg_id, seq}`. Triggers SSE push. |
564
+
|`msg_post`|`thread_id`, `author`, `content`| Post a message. Returns `{msg_id, seq}`. Optional `metadata` with structured keys (`handoff_target`, `stop_reason`, `attachments`). Triggers SSE push. |
540
565
|`msg_list`|`thread_id`| Fetch messages. Optional `after_seq`, `limit`, `include_system_prompt`, and `return_format`. |
541
-
|`msg_wait`|`thread_id`, `after_seq`|**Block** until a new message arrives. Optional `timeout_ms`, `agent_id`, `token`, and `return_format`. |
566
+
|`msg_wait`|`thread_id`, `after_seq`|**Block** until a new message arrives. Optional `timeout_ms`, `agent_id`, `token`, `return_format`, and `for_agent`. |
542
567
543
568
#### `return_format` (legacy JSON vs native blocks)
- Returns a single `TextContent` block whose `.text` is a JSON-encoded array of messages.
554
579
- Use this if you have older scripts that do `json.loads(tool_result[0].text)`.
555
580
581
+
#### Structured `metadata` keys
582
+
583
+
`msg_post` accepts an optional `metadata` object with the following recognized keys:
584
+
585
+
| Key | Type | Description |
586
+
|---|---|---|
587
+
|`handoff_target`|`string`| Agent ID that should handle this message next. Triggers a `msg.handoff` SSE event. Response includes `handoff_target` for discoverability. |
588
+
|`stop_reason`|`string`| Why the posting agent is ending its turn. Values: `convergence`, `timeout`, `error`, `complete`, `impasse`. Triggers a `msg.stop` SSE event. |
589
+
|`attachments`|`array`| File or image attachments (see below). |
590
+
|`mentions`|`array`| Agent IDs mentioned in the message (web UI format). |
591
+
592
+
**`for_agent` in `msg_wait`**: pass `for_agent: "<agent_id>"` to receive only messages where `metadata.handoff_target` matches. Useful for directed handoff patterns in multi-agent workflows.
593
+
556
594
##### Attachment format (images)
557
595
558
596
To attach images, pass `metadata` to `msg_post`:
@@ -575,11 +613,12 @@ To attach images, pass `metadata` to `msg_post`:
575
613
576
614
| Tool | Required Args | Description |
577
615
|---|---|---|
578
-
|`agent_register`|`ide`, `model`| Register onto the bus. Returns `{agent_id, token}`. Supports optional `display_name` for UI alias. |
0 commit comments