-
Notifications
You must be signed in to change notification settings - Fork 5
discovery functions as tools #37
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
… and parameter validation across MCP tools. This change improves code consistency and readability by centralizing common functionalities.
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.
Pull Request Overview
This PR refactors various MCP tool handlers to use helper functions from the common package and adds the new "functions-as-tools" feature, enabling Pulsar Functions to be dynamically exposed as MCP tools. Key changes include updating function calls (e.g. getOptions, requiredParam, optionalParam) to their common counterparts, bumping the mcp-go dependency version, and documentation and Makefile updates for licensing and feature support.
Reviewed Changes
Copilot reviewed 68 out of 68 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/mcp/prompts.go | Replace local utility calls with common.* helper functions |
| pkg/mcp/kafka_client_produce_tools.go | Update parameter retrieval to use common.RequiredParam/OptionalParam |
| pkg/mcp/kafka_client_consume_tools.go | Update parameter retrieval to use common.RequiredParam/OptionalParam |
| pkg/mcp/kafka_admin_topics_tools.go | Replace local utility calls with common.* helper functions |
| pkg/mcp/kafka_admin_sr_tools.go | Update parameter retrieval to use common.RequiredParam/OptionalParam |
| pkg/mcp/kafka_admin_partitions_tools.go | Replace local utility calls with common.* helper functions |
| pkg/mcp/kafka_admin_groups_tools.go | Replace local utility calls with common.* helper functions |
| pkg/mcp/kafka_admin_connect_tools.go | Update parameter retrieval and conversion to use common.* functions |
| pkg/mcp/features.go | Add new feature constant "functions-as-tools" |
| pkg/mcp/context_utils.go | Replace internal calls with common.* helper functions |
| pkg/mcp/context_tools.go | Replace context value retrieval and parameter functions with common.* |
| pkg/common/utils.go | Rename utility functions for consistency and add numeric type checks |
| pkg/cmd/mcp/stdio.go | Update context key usage to refer to common.OptionsKey |
| pkg/cmd/mcp/sse.go | Update context key and server shutdown calls to use common values |
| go.work.sum & go.mod | Bump mcp-go dependency to v0.28.0 and add additional dependencies |
| docs/tools/functions_as_tools.md | Add documentation for dynamically exposing Pulsar Functions as tools |
| README.md | Update feature table with "functions-as-tools" entry |
| Makefile & .licenserc.yaml | Add/update licensing tasks and configuration |
making pulsar functions be able to exported as MCP tools