> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Define validated, approval-gated, manual, and progress-producing PHP tools.

Create `Tool` values and pass them through `AgentSdk::defineTool(...)`. Tools can include:

* JSON `parameters` shown to the model
* `inputSchema`, `outputSchema`, and `eventSchema` validation callables
* `timeoutMs` and an `execute` callback
* boolean or callable `requireApproval`
* `onToolCalled` and `onResponseReceived` for interactive work
* `nextTurnParams` and `onError: "return-to-model"`

Use `RuntimeContext::$emitProgress` for preliminary results and `$setContext` for application context.

<Note>
  Tool callbacks execute synchronously in the standard PHP runtime. Concurrency and interruption therefore follow the capabilities of the PHP process hosting the SDK.
</Note>

## Related

* [State and approval](./agent-sdk-state-and-approval)
* [Run controls](./agent-sdk-run-controls)
