types

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 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

View Source
const ClientContextCLIParam = "cli"

ClientContextCLIParam is the wire value for CLI context in API query parameters.

Variables

This section is empty.

Functions

func WithClientContext added in v0.7.0

func WithClientContext(ctx context.Context, cc ClientContext) context.Context

WithClientContext returns a new context with the given ClientContext.

Types

type ClientContext added in v0.7.0

type ClientContext int

ClientContext identifies the calling context for resource handlers.

const (
	// ClientContextMCP indicates the caller is an MCP client (LLM tool use).
	ClientContextMCP ClientContext = iota
	// ClientContextCLI indicates the caller is a CLI agent using panda commands.
	ClientContextCLI
)

func GetClientContext added in v0.7.0

func GetClientContext(ctx context.Context) ClientContext

GetClientContext extracts the ClientContext from a context. Returns ClientContextMCP as the default.

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 EIP added in v0.12.0

type EIP struct {
	Number      int    `json:"number"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Author      string `json:"author,omitempty"`
	Status      string `json:"status"`
	Type        string `json:"type"`
	Category    string `json:"category,omitempty"`
	Created     string `json:"created,omitempty"`
	Requires    string `json:"requires,omitempty"`
	Content     string `json:"content,omitempty"`
	URL         string `json:"url"`
}

EIP represents a parsed Ethereum Improvement Proposal.

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