types

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NameSeparator = "__"

Variables

This section is empty.

Functions

func CompactParamsFromSchema

func CompactParamsFromSchema(schema json.RawMessage) string

CompactParamsFromSchema generates a compact parameter summary from a JSON Schema. Format: "param1:type*, param2:type" where * marks required params.

func ParsePrefixedName

func ParsePrefixedName(name string) (server, tool string, err error)

ParsePrefixedName splits "server__tool" into (server, tool). Splits on the first occurrence of "__".

func PrefixedName

func PrefixedName(server, tool string) string

PrefixedName returns "server__tool".

Types

type ProxyConfig

type ProxyConfig struct {
	GeminiAPIKey       string                  `json:"gemini_api_key,omitempty"`
	Search             SearchConfig            `json:"search,omitempty"`
	IdleTimeoutMinutes int                     `json:"idle_timeout_minutes,omitempty"`
	CallTimeoutSeconds int                     `json:"call_timeout_seconds,omitempty"`
	MCPServers         map[string]ServerConfig `json:"mcpServers"`
}

ProxyConfig is the full proxy configuration.

type SearchConfig

type SearchConfig struct {
	DefaultLimit int    `json:"default_limit,omitempty"`
	Model        string `json:"model,omitempty"`
}

SearchConfig holds search engine settings.

type SearchResult

type SearchResult struct {
	Name          string `json:"name"`           // prefixed name
	Description   string `json:"description"`    // first sentence
	CompactParams string `json:"compact_params"` // param summary
}

SearchResult is returned by the search engine.

type ServerConfig

type ServerConfig struct {
	Type    string            `json:"type,omitempty"`    // "stdio" or "http" (default: "stdio")
	Command string            `json:"command,omitempty"` // for stdio
	Args    []string          `json:"args,omitempty"`    // for stdio
	Env     map[string]string `json:"env,omitempty"`     // for stdio
	URL     string            `json:"url,omitempty"`     // for http
}

ServerConfig defines how to connect to an upstream MCP server.

func (ServerConfig) EffectiveType

func (s ServerConfig) EffectiveType() string

EffectiveType returns the server type, defaulting to "stdio".

type ServerStatus

type ServerStatus struct {
	Name        string `json:"name"`
	Connected   bool   `json:"connected"`
	ToolCount   int    `json:"tool_count"`
	LastRefresh string `json:"last_refresh"`
	Error       string `json:"error,omitempty"`
}

ServerStatus reports health info for an upstream server.

type ToolEntry

type ToolEntry struct {
	Name          string          `json:"name"`           // prefixed: "servername__toolname"
	ServerName    string          `json:"server_name"`    // which upstream server
	OriginalName  string          `json:"original_name"`  // unprefixed tool name
	Description   string          `json:"description"`    // tool description
	InputSchema   json.RawMessage `json:"input_schema"`   // full JSON Schema
	CompactParams string          `json:"compact_params"` // "chat_id:string*, message:string*"
}

ToolEntry represents a cached tool from an upstream MCP server.

Jump to

Keyboard shortcuts

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