Merge orchestrator and MCP tools into OpenAI function-calling format.
(
orchestrator_tools: list[OrchestratorTool],
mcp_tools: list[dict[str, Any]],
)
| 141 | |
| 142 | |
| 143 | def tools_to_openai_format( |
| 144 | orchestrator_tools: list[OrchestratorTool], |
| 145 | mcp_tools: list[dict[str, Any]], |
| 146 | ) -> list[dict[str, Any]]: |
| 147 | """Merge orchestrator and MCP tools into OpenAI function-calling format.""" |
| 148 | combined = [] |
| 149 | for tool in orchestrator_tools: |
| 150 | combined.append( |
| 151 | { |
| 152 | "type": "function", |
| 153 | "function": { |
| 154 | "name": tool.name, |
| 155 | "description": tool.description, |
| 156 | "parameters": tool.parameters, |
| 157 | }, |
| 158 | } |
| 159 | ) |
| 160 | combined.extend(mcp_tools) |
| 161 | return combined |
| 162 | |
| 163 | |
| 164 | def build_plan_tools( |
no outgoing calls
no test coverage detected