fix: Update @mcp.resource to use function documentation as default descrip…#489
Merged
ihrpr merged 7 commits intomodelcontextprotocol:mainfrom May 15, 2025
Merged
fix: Update @mcp.resource to use function documentation as default descrip…#489ihrpr merged 7 commits intomodelcontextprotocol:mainfrom
ihrpr merged 7 commits intomodelcontextprotocol:mainfrom
Conversation
ihrpr
requested changes
Apr 30, 2025
Contributor
ihrpr
left a comment
There was a problem hiding this comment.
Thank you for working on this.
I think it would better suited to add from_funciton method as we have in Tool and Templave and there do things like func_doc = description or fn.__doc__ or ""
Please can you also add tests? #501 had some tests related to this.
1e4a286 to
1140d1f
Compare
…tion if not provided
Contributor
Author
Thanks for your comment. I add |
ihrpr
requested changes
May 7, 2025
Contributor
ihrpr
left a comment
There was a problem hiding this comment.
thank you, a few changes and good to merge:
- return type
- func_name should be used in name
- update docstring
| description: str | None = None, | ||
| mime_type: str | None = None, | ||
| ): | ||
| """Create a template from a function.""" |
…ption if not provided
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mcp.resource doesn't generate correctly description from func.doc.
see #488
Motivation and Context
generate correctly description from func.doc when param description is none.
How Has This Been Tested?
Yes
Breaking Changes
No
Types of changes
Checklist
Additional context