-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Update @mcp.resource to use function documentation as default descrip… #489
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Thanks for your comment. I add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
…ption if not provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
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