Spawn and coordinate AI sub-agents via MakerAI AgentScheduler (_PAI_Spawn). Define an agent's goal, available tools, memory namespace and LLM model, then run it synchronously (await result) or asynchronously (fire-and-forget with instance ID).
blackboard: TPAIBlackboard — _PAI_Send for inter-agent communication
memory: TPAIAgentMemory — per-agent namespace
Input Parameters
Parameter
Type
Description
operationrequired
string
'spawn': create and start an agent; 'status': get agent run status; 'cancel': stop a running agent; 'send': send a message to running agent via blackboard; 'await': wait for agent completion and get result. One of: spawn, status, cancel, send, await.
agent_nameoptional
string
Agent definition name (spawn). Must match a registered agent type.
goaloptional
string
Natural language goal for the agent to accomplish (spawn).
toolsoptional
array[string]
MCP tool names available to the agent (spawn). E.g. ['mcp-fetch', 'mcp-sqlite'].
memory_namespaceoptional
string
Agent memory namespace. Default: auto-generated from instance ID.
modeloptional
string
LLM model for the agent. Empty = router default.
max_stepsoptional
integer
Max reasoning steps before forced stop. Default: 20. Default: 20.
asyncoptional
boolean
If true, returns immediately with instance_id. If false, waits for completion. Default: false. Default: False.
argsoptional
object
Initial arguments passed to the agent (spawn).
instance_idoptional
string
Agent instance ID (for status, cancel, send, await).
messageoptional
object
Message payload to send to running agent (send operation).
topicoptional
string
Blackboard topic for inter-agent messaging (send).
Discovery hint: Install with ppm install mcp-agent or invoke remotely via POST /v1/invoke/mcp-agent on the MCP Service.
PascalAI Usage
uses toolslib;
var Tool := LoadTool('mcp-agent');
var R := Tool.Call(JsonObj([
'operation','spawn',
'agent_name','researcher',
'goal','Summarize latest AI news',
'tools',JsonArr(['mcp-fetch','mcp-brave-search'])
]));
Writeln(R['result']);