Skip to content

Commit f11fbdb

Browse files
Fix lint and mypy
1 parent 762c536 commit f11fbdb

File tree

2 files changed

+140
-159
lines changed

2 files changed

+140
-159
lines changed

src/agents/mcp/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)