agent_spawn
Assign and dispatch tasks to named agents in a multi-agent swarm. Write task records to the blackboard with agent ID, task key, and instruction for execution on the agent's next poll cycle.
Instructions
Write a task record to the blackboard to dispatch work to a named agent on its next poll cycle. Returns {ok:true, taskKey, agentId, instruction, written:true} on success. Returns {ok:false, error:"..."} if agent_id, task_key, or instruction is missing, or if payload_json is malformed. Call agent_list first to confirm the target agent is registered; verify the task was recorded with blackboard_read after spawning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ttl | No | Time-to-live for the task entry in seconds (default: 3600) | |
| agent_id | Yes | ID of the agent to assign the task to (e.g. "code_writer", "data_analyst") | |
| task_key | Yes | Blackboard key for the task (e.g. "task:write:auth_module") | |
| instruction | Yes | Natural language instruction for the agent | |
| payload_json | No | Optional JSON-encoded extra payload for the agent |