metadata

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: 10 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 metadata exposes the Dapr sidecar's component inventory as the get_components MCP tool.

Index

Constants

View Source
const (
	TypePrefixState        = "state."
	TypePrefixPubSub       = "pubsub."
	TypePrefixBindings     = "bindings."
	TypePrefixConversation = "conversation."
	TypePrefixSecretStores = "secretstores."
	TypePrefixLock         = "lock."
	TypePrefixCrypto       = "crypto."
)

Dapr component type prefixes of the building blocks this server exposes.

Variables

This section is empty.

Functions

func RegisterTools

func RegisterTools(server *mcp.Server, client MetadataClient, metrics *telemetry.ToolMetrics, opts ...Option)

RegisterTools registers the get_components tool on server. metrics may be nil.

Types

type ComponentInfo

type ComponentInfo struct {
	Name         string   `json:"name" jsonschema:"The unique name of the component."`
	Type         string   `json:"type" jsonschema:"The type of the component (e.g., state.redis, pubsub.redis)."`
	Version      string   `json:"version,omitempty" jsonschema:"The version of the Component (e.g., v1)."`
	Capabilities []string `json:"capabilities" jsonschema:"The capabilities of the Component."`
}

ComponentInfo describes one Dapr component loaded in the sidecar.

func GetLiveComponentList

func GetLiveComponentList(ctx context.Context, client MetadataClient) ([]ComponentInfo, error)

GetLiveComponentList asks the sidecar for its registered components and returns those belonging to a building block this server exposes. The result is never nil, so it marshals as an empty JSON array.

type ComponentListWrapper

type ComponentListWrapper struct {
	Components []ComponentInfo `json:"components" jsonschema:"A list of Dapr components found in the sidecar."`
}

ComponentListWrapper is the structured result of the get_components tool.

type ComponentsObserver added in v0.0.2

type ComponentsObserver func() func([]ComponentInfo)

ComponentsObserver is called before each get_components fetch from the sidecar. If the fetch succeeds, the function it returns is called with the component list. Starting before the fetch lets the observer order the results of concurrent fetches.

type MetadataClient

type MetadataClient interface {
	GetMetadata(ctx context.Context) (*dapr.GetMetadataResponse, error)
}

MetadataClient defines the interface for metadata operations.

type Option added in v0.0.2

type Option func(*handler)

Option configures the get_components tool.

func WithComponentsObserver added in v0.0.2

func WithComponentsObserver(observe ComponentsObserver) Option

WithComponentsObserver tells observe about each get_components call, so the caller can react to components the sidecar has loaded or unloaded since the last call.

Jump to

Keyboard shortcuts

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