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

# OpenAI Agents SDK

> Expose Darwin Search and Act as bounded tools in an OpenAI agent.

Connect the agent to Darwin MCP when your runtime supports remote MCP servers. Otherwise wrap the Darwin SDK with explicit server-side tools.

[Copy the tested dynamic-MCP recipe](https://github.com/darwin-studios/darwin-integrations/blob/main/frameworks/openai-agents-sdk.md).

## Tool boundary

* Make Search available as a read-only tool.
* Keep each Action operation separate so approvals and other writes remain visible.
* Store capability revisions, `actionId`, and `requestId` in application state.
* Return Darwin's structured nonterminal state to the agent without rewriting it as success.

Use `https://mcp.darwin.so/mcp` for MCP or install `@darwinso/sdk` for direct server integration.

## Recommended tool shape

| Tool class                      | Side effect            | Application behavior                                             |
| ------------------------------- | ---------------------- | ---------------------------------------------------------------- |
| Search                          | Read-only              | Show canonical results and preserve the selected revision.       |
| Start / Update / Approve / Stop | Mutation               | Require a stable `requestId` and the appropriate user authority. |
| Get / List                      | Read-only Action state | Recover truth after retries, handoffs, and restarts.             |

Return structured Darwin responses to the application layer. Let the UI own sensitive interactions and exact approvals instead of asking the model to simulate them.
