Skip to content

Conversation

@d3flex
Copy link

@d3flex d3flex commented Jan 12, 2026

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

@d3flex d3flex force-pushed the feat/tool_annotations branch from 24e4818 to 52453f9 Compare January 13, 2026 07:38
d3flex added a commit to d3flex/openQA that referenced this pull request Jan 13, 2026
@d3flex d3flex marked this pull request as ready for review January 13, 2026 07:48
Copy link

@Martchus Martchus left a 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.


# Only include annotations if at least one field is set
my $annotations = $tool->annotations;
$info->{annotations} = $annotations if %$annotations;

Choose a reason for hiding this comment

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

Suggested change
$info->{annotations} = $annotations if %$annotations;
$info->{annotations} = $annotations if keys %$annotations;

lib/MCP/Tool.pm Outdated
Comment on lines 116 to 117
Optional annotations for the tool which provide additional metadata about tool
behavior.

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines +114 to +117
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';

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).

Copy link
Author

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?

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.

@d3flex d3flex force-pushed the feat/tool_annotations branch from 52453f9 to 5587abe Compare January 13, 2026 13:37
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]>
@d3flex d3flex force-pushed the feat/tool_annotations branch from 5587abe to 5a9047f Compare January 13, 2026 14:22
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