> ## 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 C# tools.

Create `Tool` records and pass them through `AgentSdk.DefineTool(...)`. A tool can include:

* JSON `Parameters` shown to the model
* `InputSchema`, `OutputSchema`, and `EventSchema` validation delegates
* a per-tool `Timeout` and asynchronous `Execute` delegate
* unconditional or conditional approval
* `OnToolCalled` and `OnResponseReceived` for interactive work
* next-turn overrides and recoverable tool-error handling

Use `RuntimeContext.EmitProgress` for preliminary results, `SetContext` for application context, and `CancellationToken` for cancellation-aware dependencies.

Independent tools can run concurrently through `ToolExecutionConfig`. Saved tool-result messages retain model call order even if execution finishes in a different order.

## Related

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