In PHP, direct tool invocation is represented by ToolInvoke and
handled by ToolInvocationHandler.
JobState includes accepted, queued, running, blocked, paused,
completed, failed, and cancelled.
$result = $client->invokeTool('planner@1.0.0', ['task' => 'write']);$runtime->registerTool('planner', $handler);
$runtime->registerToolVersion('planner', '1.0.0', $handler);
$runtime->setDefaultToolVersion('planner', '1.0.0');PHP uses method parameters and typed IDs rather than a single submit options object:
$client->invokeTool('echo', [], traceId: TraceId::random(), idempotencyKey: $key);Pass IdempotencyKey to invokeTool() for mutating operations.
Call ARCPClient::cancelJob($jobId). Tool handlers should accept and
observe Amp\Cancellation.
Pass $deadlineSeconds to invokeTool() to bound the await.
Pass ['lease' => ['cost.budget' => ['USD:1.00']]]; cost metrics
decrement the counter and can raise BudgetExhaustedException.
Use name@version in tool names. Missing versions raise
AgentVersionNotAvailableException.
The runtime emits accepted/started/terminal job messages, maps typed exceptions to errors, and removes terminal jobs from the live list.
See samples/agent-versions/, samples/list-jobs/, and
tests/Integration/JobLifecycleTest.php.