Skip to content

feat: add tool meta - #269

Merged
iFurySt merged 1 commit into
AmoyLab:mainfrom
qiankunli:feat/add-tool-meta
Oct 17, 2025
Merged

iFurySt merged 1 commit into
AmoyLab:mainfrom
qiankunli:feat/add-tool-meta

Conversation

@qiankunli

@qiankunli qiankunli commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Add support for tool metadata by introducing a Meta field in configuration, schema types, and including it in server-side SSE responses.

New Features:

  • Add Meta field to ToolSchema and ToolConfig for arbitrary tool metadata

Enhancements:

  • Include Meta field in SSE server responses when posting tool messages

@sourcery-ai

sourcery-ai Bot commented Oct 17, 2025 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR extends the MCP tooling protocol by introducing a new Meta field for tool metadata across configuration, schema definitions, and message propagation, ensuring metadata is captured, serialized, and sent over SSE.

Class diagram for updated ToolSchema and ToolConfig types

classDiagram
    class ToolSchema {
        string Name
        string Description
        ToolInputSchema InputSchema
        ToolAnnotations* Annotations
        map~string, any~ Meta
    }
    class ToolConfig {
        string Name
        string Description
        string ResponseBody
        map~string, any~ InputSchema
        map~string, any~ Annotations
        map~string, any~ Meta
        ToToolSchema() ToolSchema
    }
    ToolConfig --> ToolSchema : ToToolSchema()
Loading

File-Level Changes

Change Details Files
Define Meta in MCP server ToolSchema
  • add Meta map[string]any field with JSON “_meta”
  • include documentation link to Python SDK
pkg/mcp/server_types.go
Support Meta in ToolConfig and conversion
  • add Meta field to ToolConfig struct
  • map ToolConfig.Meta to mcp.ToolSchema.Meta
internal/common/config/mcp.go
Propagate tool Meta in SSE payloads
  • include tool.Meta in the SSE message structure
internal/core/sse.go
Adjust import ordering for trace package
  • reposition apptrace import below oteltrace
internal/core/sse.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@iFurySt
iFurySt merged commit bfa55fe into AmoyLab:main Oct 17, 2025
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