Skip to content
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

fix: standardize resource response format #186

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

dsp-ant
Copy link
Member

@dsp-ant dsp-ant commented Feb 3, 2025

Github-Issue:#141

Copy link
Contributor

@jerome3o-anthropic jerome3o-anthropic left a comment

Choose a reason for hiding this comment

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

lgtm! (one non blocking qn)

# Test case 2: Template with optional parameter (should fail)
with pytest.raises(ValueError, match="Mismatch between URI parameters"):

@mcp.resource("resource://users/{user_id}/profile")
Copy link
Contributor

Choose a reason for hiding this comment

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

[q] is this because it should be optional in the template also (i.e. as a query param)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it should match the numbedr of arguments. If you dont want an argument it shouldnt be specified in the resource.

@dsp-ant dsp-ant merged commit 51e65c8 into main Feb 4, 2025
5 checks passed
@dsp-ant dsp-ant deleted the fix/141-resource-templates branch February 4, 2025 14:25
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