File tree Expand file tree Collapse file tree 2 files changed +140
-159
lines changed
Expand file tree Collapse file tree 2 files changed +140
-159
lines changed Original file line number Diff line number Diff line change @@ -194,13 +194,13 @@ async def invoke_mcp_tool(
194194 else :
195195 logger .debug (f"MCP tool { tool .name } returned { result } " )
196196
197-
198197 # If structured content is requested and available, use it exclusively
199198 if server .use_structured_content and result .structuredContent :
200199 tool_output = json .dumps (result .structuredContent )
201200 else :
202- # The MCP tool result is a list of content items, whereas OpenAI tool outputs are a single
203- # string. We'll try to convert.
201+ # Fall back to regular text content processing
202+ # The MCP tool result is a list of content items, whereas OpenAI tool
203+ # outputs are a single string. We'll try to convert.
204204 if len (result .content ) == 1 :
205205 tool_output = result .content [0 ].model_dump_json ()
206206 elif len (result .content ) > 1 :
You can’t perform that action at this time.
0 commit comments