Skip to content

Ensure item.model_dump only contains JSON serializable types #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025

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
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