pubsub

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func ToolNames added in v0.0.2

func ToolNames() []string

ToolNames returns the names of the tools RegisterTools adds.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL