Function tools + MCP

OpenAI Agents SDK

Expose a typed Python function or an MCP server as a callable agent tool.

Connect finance tools to OpenAI Agents SDK

  1. 1

    Install the platform and required runtime

  2. 2

    Create or choose a read-only finance tool

  3. 3

    Add the configuration in the documented location

  4. 4

    Restart, inspect available tools and run a test prompt

Starter configuration

Function tools + MCP
from agents import Agent, Runner, function_tool

@function_tool
def get_financial_data(symbol: str) -> dict:
    """Return verified financial data for a ticker."""
    return fetch_from_source(symbol)

agent = Agent(name="Investor", tools=[get_financial_data])
result = Runner.run_sync(agent, "Research AAPL")

Security rules

Start with read-only tools. Never expose brokerage execution, unrestricted file access or secrets to an untrusted server.

Open official documentation