Skip to content

Conversation

westhood
Copy link
Contributor

@westhood westhood commented Jun 2, 2025

The EmbeddedResource from MCP tool call contains a field with type AnyUrl that is not JSON-serializable. To avoid this exception, use item.model_dump(mode="json") to ensure a JSON-serializable return value.

@westhood
Copy link
Contributor Author

westhood commented Jun 2, 2025

without this patch,the agent framework can not work with mcp tool with Embedded Resources reponses, like https://github.com/mark3labs/mcp-filesystem-server

@rm-openai
Copy link
Collaborator

thanks!

@rm-openai rm-openai merged commit 775d3e2 into openai:main Jun 2, 2025
5 checks passed
KatHaruto pushed a commit to KatHaruto/openai-agents-python that referenced this pull request Jun 10, 2025
)

The EmbeddedResource from MCP tool call contains a field with type
AnyUrl that is not JSON-serializable. To avoid this exception, use
item.model_dump(mode="json") to ensure a JSON-serializable return value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants