Skip to main content

to_openai_tool

Method
This is a method of the MCP class in the mcp module.
Convert the MCP tool to an OpenAI-compatible tool definition. This method is specifically invoked by the Agent class when using provider/model format (e.g., “openai/gpt-4o-mini”).

Signature

def to_openai_tool() -> Any

Returns

Returns
Any
OpenAI-compatible tool definition(s)