Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Convert MCP schemas to strict where possible #414

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
Apr 1, 2025
Merged

Convert MCP schemas to strict where possible #414

merged 1 commit into from
Apr 1, 2025

Conversation

rm-openai
Copy link
Collaborator

Summary:

Towards #404. I made this configurable because it's not clear this is always a good thing to do. I also made it default to False because I'm not sure if this could cause errors.

If it works out well, we can switch the default in the future as a small breaking changes

Test Plan:

Unit tests

## Summary:
Towards #404. I made this configurable because it's not clear this is always a good thing to do. I also made it default to False because I'm not sure if this could cause errors.

If it works out well, we can switch the default in the future as a small breaking changes

## Test Plan:
Unit tests
class MCPConfig(TypedDict):
"""Configuration for MCP servers."""

convert_schemas_to_strict: NotRequired[bool]
Copy link
Contributor

@pakrym-oai pakrym-oai Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It slightly feels like the wrong place to do this. IMO the MCP server should be responsible to declaring itself as strict.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you mean the actual MCP server, then yes I agree. That is a more involved change though, since MCP servers adhere to a published spec.

I didn't add it to the MCP server class in the repo, because I think those should be very thin wrappers around the actual MCP server, in order to be reused in other places outside the agents SDK internals.

Gonna merge this - but if you think we should implement it differently ping me and we can revert/re-do it!

@rm-openai rm-openai merged commit 01f5e86 into main Apr 1, 2025
10 checks passed
@rm-openai rm-openai deleted the rm/pr414 branch April 1, 2025 20:50
Lightblues pushed a commit to Lightblues/openai-agents-python that referenced this pull request Apr 13, 2025
## Summary:
Towards openai#404. I made this configurable because it's not clear this is
always a good thing to do. I also made it default to False because I'm
not sure if this could cause errors.

If it works out well, we can switch the default in the future as a small
breaking changes

## Test Plan:
Unit tests
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