Using with OpenAI Agents
Legend Prime’s MCP server works natively with the OpenAI Responses API. Pass the server URL and the model discovers tools automatically.Setup
Add Legend as an MCP tool source in your Responses API call:mcp_list_tools output with all available tools. The model then decides which to call.
Tool Discovery
On the first request, the API fetches tools:mcp_list_tools is in the conversation context, the API won’t re-fetch on subsequent turns.
Tool Calls
When the model calls a tool, you seemcp_call items:
Handling Plan Execution
Read-only operations (list_accounts, get_portfolio, list_assets) work seamlessly. For plan execution, your orchestrator needs to handle signing:
--auto-sign on the CLI for a simpler flow:
Filtering Tools
If you only need a subset of tools, useallowed_tools: