Documentation
¶
Overview ¶
Package pubsub exposes the Dapr publish and subscribe building block as MCP tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client PubSubClient, metrics *telemetry.ToolMetrics)
RegisterTools registers the publish_event and publish_event_with_metadata tools on server. metrics may be nil.
Types ¶
type PubSubClient ¶
type PubSubClient interface {
PublishEvent(ctx context.Context, pubsubName, topicName string, data interface{}, opts ...dapr.PublishEventOption) error
}
PubSubClient defines the interface for pub/sub operations.
type PublishArgs ¶
type PublishArgs struct {
PubsubName string `json:"pubsubName" jsonschema:"The name of the Dapr pubsub component (e.g., 'pubsub')."`
Topic string `json:"topic" jsonschema:"The topic to publish the message to (e.g., 'orders')."`
Message string `json:"message" jsonschema:"The message payload to publish, typically a JSON string."`
ContentType string `` /* 154-byte string literal not displayed */
}
PublishArgs are the arguments of the publish_event tool.
type PublishWithMetadataArgs ¶
type PublishWithMetadataArgs struct {
PubsubName string `json:"pubsubName" jsonschema:"The name of the Dapr pubsub component (e.g., 'pubsub')."`
Topic string `json:"topic" jsonschema:"The topic to publish the message to (e.g., 'orders')."`
Message string `json:"message" jsonschema:"The message payload to publish, typically a JSON string."`
ContentType string `` /* 154-byte string literal not displayed */
Metadata map[string]string `` /* 136-byte string literal not displayed */
}
PublishWithMetadataArgs are the arguments of the publish_event_with_metadata tool.