-
Notifications
You must be signed in to change notification settings - Fork 3
Add MCP tool annotations support #2
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
base: main
Are you sure you want to change the base?
Conversation
24e4818 to
52453f9
Compare
This reverts commit 9f68de6. Depends-on: mojolicious/mojo-mcp#2
Martchus
left a comment
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.
Take my review with a grain of Salt as I don't really know the mojo-mcp project.
lib/MCP/Server.pm
Outdated
|
|
||
| # Only include annotations if at least one field is set | ||
| my $annotations = $tool->annotations; | ||
| $info->{annotations} = $annotations if %$annotations; |
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.
| $info->{annotations} = $annotations if %$annotations; | |
| $info->{annotations} = $annotations if keys %$annotations; |
lib/MCP/Tool.pm
Outdated
| Optional annotations for the tool which provide additional metadata about tool | ||
| behavior. |
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.
| Optional annotations for the tool which provide additional metadata about tool | |
| behavior. | |
| Optional annotations for the tool which provide additional metadata about the | |
| tool behavior. |
| ok !exists $tool->{annotations}{readOnlyHint}, 'no readOnlyHint'; | ||
| ok !exists $tool->{annotations}{destructiveHint}, 'no destructiveHint'; | ||
| ok !exists $tool->{annotations}{idempotentHint}, 'no idempotentHint'; | ||
| ok !exists $tool->{annotations}{openWorldHint}, 'no openWorldHint'; |
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 should probably verify that these hints are serialized as boolean (and not e.g. as number).
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.
The think is that it serializes only the fields that are set. So there is nothing as boolean here.
ok 2 - has title annotation
$VAR1 = {
'title' => 'Server Information'
};
Unless you are talking about the Full annotations subtest?
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.
Oh, right. Then I guess this remark still counts for the Full annotations subtest.
52453f9 to
5587abe
Compare
Implement per MCP specification: https://modelcontextprotocol.io/specification/draft/schema#toolannotations adding annotations attribute to MCP::Tool related_issue: https://progress.opensuse.org/issues/193555 Signed-off-by: Ioannis Bonatakis <[email protected]>
5587abe to
5a9047f
Compare
Implement per MCP specification:
https://modelcontextprotocol.io/specification/draft/schema#toolannotations adding annotations attribute to MCP::Tool
related_issue: https://progress.opensuse.org/issues/193555