mcp

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 0 Imported by: 809

Documentation

Index

Constants

View Source
const (
	RefTypePrompt   = "ref/prompt"
	RefTypeResource = "ref/resource"
)

Constants for reference types

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations struct {
	Audience []Role  `json:"audience,omitempty"`
	Priority float64 `json:"priority,omitempty"`
}

type BlobResourceContents

type BlobResourceContents struct {
	Blob     []byte `json:"blob"`
	MimeType string `json:"mimeType,omitempty"`
	URI      string `json:"uri"`
}

type CallToolResult

type CallToolResult struct {
	Meta    *MetaData `json:"_meta,omitempty"`
	Content []Content `json:"content"`
	IsError bool      `json:"isError,omitempty"`
}

type ClientCapabilities

type ClientCapabilities struct {
	Experimental map[string]map[string]interface{} `json:"experimental,omitempty"`
	Roots        *struct {
		ListChanged bool `json:"listChanged"`
	} `json:"roots,omitempty"`
	Sampling map[string]interface{} `json:"sampling,omitempty"`
}

type CompleteArgument

type CompleteArgument struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type CompleteResult

type CompleteResult struct {
	Meta       *MetaData  `json:"_meta,omitempty"`
	Completion Completion `json:"completion"`
}

type Completion

type Completion struct {
	HasMore bool     `json:"hasMore,omitempty"`
	Total   int      `json:"total,omitempty"`
	Values  []string `json:"values"`
}

type Content

type Content interface{} // Can be TextContent, ImageContent, or EmbeddedResource

type EmbeddedResource

type EmbeddedResource struct {
	Annotations *Annotations     `json:"annotations,omitempty"`
	Resource    ResourceContents `json:"resource"`
	Type        string           `json:"type"` // Always "resource"
}

type GetPromptResult

type GetPromptResult struct {
	Meta        *MetaData       `json:"_meta,omitempty"`
	Description string          `json:"description,omitempty"`
	Messages    []PromptMessage `json:"messages"`
}

type ImageContent

type ImageContent struct {
	Annotations *Annotations `json:"annotations,omitempty"`
	Data        []byte       `json:"data"`
	MimeType    string       `json:"mimeType"`
	Type        string       `json:"type"` // Always "image"
}

type Implementation

type Implementation struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

Common types used by both client and server

type InitializeResult

type InitializeResult struct {
	Meta            *MetaData          `json:"_meta,omitempty"`
	Capabilities    ServerCapabilities `json:"capabilities"`
	Instructions    string             `json:"instructions,omitempty"`
	ProtocolVersion string             `json:"protocolVersion"`
	ServerInfo      Implementation     `json:"serverInfo"`
}

type ListPromptsResult

type ListPromptsResult struct {
	Meta       *MetaData `json:"_meta,omitempty"`
	NextCursor string    `json:"nextCursor,omitempty"`
	Prompts    []Prompt  `json:"prompts"`
}

type ListResourcesResult

type ListResourcesResult struct {
	Meta       *MetaData  `json:"_meta,omitempty"`
	NextCursor string     `json:"nextCursor,omitempty"`
	Resources  []Resource `json:"resources"`
}

type ListToolsResult

type ListToolsResult struct {
	Meta       *MetaData `json:"_meta,omitempty"`
	NextCursor string    `json:"nextCursor,omitempty"`
	Tools      []Tool    `json:"tools"`
}

type LoggingLevel

type LoggingLevel string
const (
	LoggingLevelEmergency LoggingLevel = "emergency"
	LoggingLevelAlert     LoggingLevel = "alert"
	LoggingLevelCritical  LoggingLevel = "critical"
	LoggingLevelError     LoggingLevel = "error"
	LoggingLevelWarning   LoggingLevel = "warning"
	LoggingLevelNotice    LoggingLevel = "notice"
	LoggingLevelInfo      LoggingLevel = "info"
	LoggingLevelDebug     LoggingLevel = "debug"
)

type MetaData

type MetaData map[string]interface{}

type Prompt

type Prompt struct {
	Arguments   []PromptArgument `json:"arguments,omitempty"`
	Description string           `json:"description,omitempty"`
	Name        string           `json:"name"`
}

type PromptArgument

type PromptArgument struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Required    bool   `json:"required,omitempty"`
}

type PromptMessage

type PromptMessage struct {
	Content Content `json:"content"`
	Role    Role    `json:"role"`
}

type PromptReference

type PromptReference struct {
	Type string `json:"type"` // const "ref/prompt"
	Name string `json:"name"`
}

Reference types

type ReadResourceResult

type ReadResourceResult struct {
	Meta     *MetaData          `json:"_meta,omitempty"`
	Contents []ResourceContents `json:"contents"`
}

type Resource

type Resource struct {
	Annotations *Annotations `json:"annotations,omitempty"`
	Description string       `json:"description,omitempty"`
	MimeType    string       `json:"mimeType,omitempty"`
	Name        string       `json:"name"`
	URI         string       `json:"uri"`
}

type ResourceContents

type ResourceContents interface{} // Can be TextResourceContents or BlobResourceContents

type ResourceReference

type ResourceReference struct {
	Type string `json:"type"` // const "ref/resource"
	URI  string `json:"uri"`
}

type Role

type Role string
const (
	RoleAssistant Role = "assistant"
	RoleUser      Role = "user"
)

type ServerCapabilities

type ServerCapabilities struct {
	Experimental map[string]map[string]interface{} `json:"experimental,omitempty"`
	Logging      map[string]interface{}            `json:"logging,omitempty"`
	Prompts      *struct {
		ListChanged bool `json:"listChanged"`
	} `json:"prompts,omitempty"`
	Resources *struct {
		ListChanged bool `json:"listChanged"`
		Subscribe   bool `json:"subscribe"`
	} `json:"resources,omitempty"`
	Tools *struct {
		ListChanged bool `json:"listChanged"`
	} `json:"tools,omitempty"`
}

type TextContent

type TextContent struct {
	Annotations *Annotations `json:"annotations,omitempty"`
	Text        string       `json:"text"`
	Type        string       `json:"type"` // Always "text"
}

type TextResourceContents

type TextResourceContents struct {
	MimeType string `json:"mimeType,omitempty"`
	Text     string `json:"text"`
	URI      string `json:"uri"`
}

type Tool

type Tool struct {
	Description string          `json:"description,omitempty"`
	InputSchema ToolInputSchema `json:"inputSchema"`
	Name        string          `json:"name"`
}

type ToolInputSchema

type ToolInputSchema struct {
	Properties map[string]interface{} `json:"properties,omitempty"`
	Type       string                 `json:"type"` // Always "object"
}

Jump to

Keyboard shortcuts

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