Skip to content

Conversation

dsp-ant
Copy link
Member

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

Github-Issue:#141

Copy link
Member

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

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