types

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package types provides shared types used across the MCP server and modules to avoid circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatasourceInfo

type DatasourceInfo struct {
	// Type is the datasource type (e.g. "clickhouse", "prometheus", "loki").
	Type string `json:"type"`
	// Name is the logical name of the datasource.
	Name string `json:"name"`
	// Description is a human-readable description.
	Description string `json:"description,omitempty"`
	// Metadata contains type-specific metadata (e.g. database, url).
	Metadata map[string]string `json:"metadata,omitempty"`
}

DatasourceInfo describes a configured datasource for the datasources:// MCP resources.

type Example

type Example struct {
	Name        string `json:"name" yaml:"name"`
	Description string `json:"description" yaml:"description"`
	Query       string `json:"query" yaml:"query"`
	Cluster     string `json:"cluster" yaml:"cluster"`
}

Example represents a single query example.

type ExampleCategory

type ExampleCategory struct {
	Name        string    `json:"name" yaml:"name"`
	Description string    `json:"description" yaml:"description"`
	Examples    []Example `json:"examples" yaml:"examples"`
}

ExampleCategory represents a category of query examples.

type FunctionDoc

type FunctionDoc struct {
	Signature   string            `json:"signature"`
	Description string            `json:"description"`
	Parameters  map[string]string `json:"parameters,omitempty"`
	Returns     string            `json:"returns,omitempty"`
	Example     string            `json:"example,omitempty"`
}

FunctionDoc describes a function in the Python library.

type ModuleDoc

type ModuleDoc struct {
	Description string                 `json:"description"`
	Functions   map[string]FunctionDoc `json:"functions"`
}

ModuleDoc describes a module in the Python library.

type ReadHandler

type ReadHandler func(ctx context.Context, uri string) (string, error)

ReadHandler handles reading a resource by URI.

type Runbook

type Runbook struct {
	// Name is the title of the runbook (imperative, e.g., "Investigate Finality Delay").
	Name string `yaml:"name" json:"name"`
	// Description is a 1-2 sentence summary for semantic search matching.
	Description string `yaml:"description" json:"description"`
	// Tags are keywords for search (e.g., "finality", "consensus", "attestations").
	Tags []string `yaml:"tags,omitempty" json:"tags,omitempty"`
	// Prerequisites lists datasources needed (e.g., "xatu", "prometheus", "dora").
	Prerequisites []string `yaml:"prerequisites,omitempty" json:"prerequisites,omitempty"`
	// Content is the markdown body (not from frontmatter).
	Content string `yaml:"-" json:"content"`
	// FilePath is the source file for debugging.
	FilePath string `yaml:"-" json:"file_path"`
}

Runbook represents a procedural guide for multi-step analysis. Runbooks contain markdown content with inline MUST/SHOULD/MAY constraints following RFC 2119 conventions.

type StaticResource

type StaticResource struct {
	Resource mcp.Resource
	Handler  ReadHandler
}

StaticResource is a resource with a fixed URI.

type TemplateResource

type TemplateResource struct {
	Template mcp.ResourceTemplate
	Pattern  *regexp.Regexp
	Handler  ReadHandler
}

TemplateResource is a resource with a URI pattern.

Jump to

Keyboard shortcuts

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