Documentation
¶
Index ¶
- Constants
- type Annotated
- type Annotations
- type BlobResourceContents
- type CallToolRequest
- type CallToolResult
- type CancelledNotification
- type ClientCapabilities
- type ClientNotify
- type ClientRequest
- type ClientResponse
- type Complete
- type CompleteRequest
- type CompleteResult
- type Content
- type CreateMessageOption
- func WithIncludeContext(ctx string) CreateMessageOption
- func WithMetadata(metadata map[string]interface{}) CreateMessageOption
- func WithModelPreferences(prefs *ModelPreferences) CreateMessageOption
- func WithStopSequences(sequences []string) CreateMessageOption
- func WithSystemPrompt(prompt string) CreateMessageOption
- func WithTemperature(temp float64) CreateMessageOption
- type CreateMessageRequest
- type CreateMessageResult
- type EmbeddedResource
- type GetPromptRequest
- type GetPromptResult
- type ImageContent
- type Implementation
- type InitializeRequest
- type InitializeResult
- type InitializedNotification
- type InputSchema
- type InputSchemaType
- type JSONRPCNotification
- type JSONRPCRequest
- type JSONRPCResponse
- type ListPromptsRequest
- type ListPromptsResult
- type ListResourceTemplatesRequest
- type ListResourceTemplatesResult
- type ListResourcesRequest
- type ListResourcesResult
- type ListRootsRequest
- type ListRootsResult
- type ListToolsRequest
- type ListToolsResult
- type LogMessageNotification
- type LoggingLevel
- type Method
- type ModelHint
- type ModelPreferences
- type PaginatedRequest
- type PaginatedResult
- type PingRequest
- type PingResult
- type ProgressNotification
- type ProgressToken
- type Prompt
- type PromptArgument
- type PromptListChangedNotification
- type PromptMessage
- type PromptReference
- type PromptsCapability
- type ReadResourceRequest
- type ReadResourceResult
- type RequestID
- type Resource
- type ResourceContents
- type ResourceListChangedNotification
- type ResourceReference
- type ResourceTemplate
- type ResourceUpdatedNotification
- type ResourcesCapability
- type Role
- type Root
- type RootsCapability
- type RootsListChangedNotification
- type SamplingMessage
- type ServerCapabilities
- type ServerNotify
- type ServerRequest
- type ServerResponse
- type SetLoggingLevelRequest
- type SetLoggingLevelResult
- type SubscribeRequest
- type SubscribeResult
- type TextContent
- type TextResourceContents
- type Tool
- type ToolListChangedNotification
- type ToolsCapability
- type UnsubscribeRequest
- type UnsubscribeResult
Constants ¶
const ( PARSE_ERROR = -32700 // Invalid JSON INVALID_REQUEST = -32600 // The JSON sent is not a valid Request object METHOD_NOT_FOUND = -32601 // The method does not exist / is not available INVALID_PARAMS = -32602 // Invalid method parameter(s) INTERNAL_ERROR = -32603 // Internal JSON-RPC error )
Standard JSON-RPC error codes
const Version = "2024-11-05"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotated ¶
type Annotated struct {
Annotations *Annotations `json:"annotations,omitempty"`
}
Annotated represents base objects that include optional annotations
type Annotations ¶
type Annotations struct {
Audience []Role `json:"audience,omitempty"`
Priority float64 `json:"priority,omitempty"`
}
Annotations represents optional annotations for objects
type BlobResourceContents ¶
type BlobResourceContents struct {
URI string `json:"uri"`
Blob []byte `json:"blob"`
MimeType string `json:"mimeType,omitempty"`
}
func (BlobResourceContents) GetMimeType ¶
func (b BlobResourceContents) GetMimeType() string
func (BlobResourceContents) GetURI ¶
func (b BlobResourceContents) GetURI() string
type CallToolRequest ¶
type CallToolRequest struct {
Name string `json:"name"`
Arguments map[string]interface{} `json:"arguments,omitempty"`
}
CallToolRequest represents a request to call a specific tool
func NewCallToolRequest ¶
func NewCallToolRequest(name string, arguments map[string]interface{}) *CallToolRequest
NewCallToolRequest creates a new call tool request
type CallToolResult ¶
type CallToolResult struct {
Content []Content `json:"content"`
IsError bool `json:"isError,omitempty"`
}
CallToolResult represents the response to a tool call
func NewCallToolResult ¶
func NewCallToolResult(content []Content, isError bool) *CallToolResult
NewCallToolResult creates a new call tool response
func (*CallToolResult) UnmarshalJSON ¶
func (r *CallToolResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for CallToolResult
type CancelledNotification ¶
type CancelledNotification struct {
RequestID RequestID `json:"requestId"`
Reason string `json:"reason,omitempty"`
}
CancelledNotification represents a notification that a request has been cancelled
func NewCancelledNotification ¶
func NewCancelledNotification(requestID RequestID, reason string) *CancelledNotification
NewCancelledNotification creates a new cancelled notification
type ClientNotify ¶
type ClientNotify interface{}
type ClientRequest ¶
type ClientRequest interface{}
type ClientResponse ¶
type ClientResponse interface{}
type CompleteRequest ¶
type CompleteRequest struct {
Argument struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"argument"`
Ref interface{} `json:"ref"` // Can be PromptReference or ResourceReference
}
CompleteRequest represents a request for completion options
func NewCompleteRequest ¶
func NewCompleteRequest(argName string, argValue string, ref interface{}) *CompleteRequest
NewCompleteRequest creates a new completion request
type CompleteResult ¶
type CompleteResult struct {
Completion Complete `json:"completion"`
}
CompleteResult represents the response to a completion request
func NewCompleteResult ¶
func NewCompleteResult(values []string, hasMore bool, total int) *CompleteResult
NewCompleteResult creates a new completion response
type CreateMessageOption ¶
type CreateMessageOption func(*CreateMessageRequest)
CreateMessageOption represents an option for creating a message
func WithIncludeContext ¶
func WithIncludeContext(ctx string) CreateMessageOption
WithIncludeContext sets the include context option for the request
func WithMetadata ¶
func WithMetadata(metadata map[string]interface{}) CreateMessageOption
WithMetadata sets the metadata for the request
func WithModelPreferences ¶
func WithModelPreferences(prefs *ModelPreferences) CreateMessageOption
WithModelPreferences sets the model preferences for the request
func WithStopSequences ¶
func WithStopSequences(sequences []string) CreateMessageOption
WithStopSequences sets the stop sequences for the request
func WithSystemPrompt ¶
func WithSystemPrompt(prompt string) CreateMessageOption
WithSystemPrompt sets the system prompt for the request
func WithTemperature ¶
func WithTemperature(temp float64) CreateMessageOption
WithTemperature sets the temperature for the request
type CreateMessageRequest ¶
type CreateMessageRequest struct {
Messages []SamplingMessage `json:"messages"`
MaxTokens int `json:"maxTokens"`
Temperature float64 `json:"temperature,omitempty"`
StopSequences []string `json:"stopSequences,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty"`
ModelPreferences *ModelPreferences `json:"modelPreferences,omitempty"`
IncludeContext string `json:"includeContext,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
CreateMessageRequest represents a request to create a message through sampling
func NewCreateMessageRequest ¶
func NewCreateMessageRequest(messages []SamplingMessage, maxTokens int, opts ...CreateMessageOption) *CreateMessageRequest
NewCreateMessageRequest creates a new create message request
type CreateMessageResult ¶
type CreateMessageResult struct {
Content Content `json:"content"`
Role Role `json:"role"`
Model string `json:"model"`
StopReason string `json:"stopReason,omitempty"`
}
CreateMessageResult represents the response to a create message request
func NewCreateMessageResult ¶
func NewCreateMessageResult(content Content, role Role, model string, stopReason string) *CreateMessageResult
NewCreateMessageResult creates a new create message response
type EmbeddedResource ¶
type EmbeddedResource struct {
Type string `json:"type"` // Must be "resource"
Resource ResourceContents `json:"resource"`
Annotations *Annotations `json:"annotations,omitempty"`
}
EmbeddedResource represents the contents of a resource, embedded into a prompt or tool call result. It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.
func NewEmbeddedResource ¶
func NewEmbeddedResource(resource ResourceContents, annotations *Annotations) *EmbeddedResource
NewEmbeddedResource creates a new EmbeddedResource
func (EmbeddedResource) GetType ¶
func (i EmbeddedResource) GetType() string
type GetPromptRequest ¶
type GetPromptRequest struct {
Name string `json:"name"`
Arguments map[string]string `json:"arguments,omitempty"`
}
GetPromptRequest represents a request to get a specific prompt
func NewGetPromptRequest ¶
func NewGetPromptRequest(name string, arguments map[string]string) *GetPromptRequest
NewGetPromptRequest creates a new get prompt request
type GetPromptResult ¶
type GetPromptResult struct {
Messages []PromptMessage `json:"messages"`
Description string `json:"description,omitempty"`
}
GetPromptResult represents the response to a get prompt request
func NewGetPromptResult ¶
func NewGetPromptResult(messages []PromptMessage, description string) *GetPromptResult
NewGetPromptResult creates a new get prompt response
type ImageContent ¶
type ImageContent struct {
Annotated
Type string `json:"type"`
Data []byte `json:"data"`
MimeType string `json:"mimeType"`
}
func (ImageContent) GetType ¶
func (i ImageContent) GetType() string
type Implementation ¶
Implementation describes the name and version of an MCP implementation
type InitializeRequest ¶
type InitializeRequest struct {
ClientInfo Implementation `json:"clientInfo"`
Capabilities ClientCapabilities `json:"capabilities"`
ProtocolVersion string `json:"protocolVersion"`
}
InitializeRequest represents the initialize request sent from client to server
func NewInitializeRequest ¶
func NewInitializeRequest(clientInfo Implementation, capabilities ClientCapabilities) *InitializeRequest
NewInitializeRequest creates a new initialize request
type InitializeResult ¶
type InitializeResult struct {
ServerInfo Implementation `json:"serverInfo"`
Capabilities ServerCapabilities `json:"capabilities"`
ProtocolVersion string `json:"protocolVersion"`
Instructions string `json:"instructions,omitempty"`
}
InitializeResult represents the server's response to an initialize request
func NewInitializeResult ¶
func NewInitializeResult(serverInfo Implementation, capabilities ServerCapabilities, instructions string) *InitializeResult
NewInitializeResult creates a new initialize response
type InitializedNotification ¶
type InitializedNotification struct {
Meta map[string]interface{} `json:"_meta,omitempty"`
}
InitializedNotification represents the notification sent from client to server after initialization
func NewInitializedNotification ¶
func NewInitializedNotification() *InitializedNotification
NewInitializedNotification creates a new initialized notification
type InputSchema ¶
type InputSchema struct {
Type InputSchemaType `json:"type"`
Properties map[string]interface{} `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
}
InputSchema represents a JSON Schema object defining the expected parameters for a tool
type JSONRPCNotification ¶
type JSONRPCNotification struct {
JSONRPC string `json:"jsonrpc"`
Method Method `json:"method"`
Params interface{} `json:"params,omitempty"`
RawParams json.RawMessage `json:"-"`
}
func NewJSONRPCNotification ¶
func NewJSONRPCNotification(method Method, params interface{}) *JSONRPCNotification
NewJSONRPCNotification creates a new JSON-RPC notification
func (*JSONRPCNotification) UnmarshalJSON ¶
func (r *JSONRPCNotification) UnmarshalJSON(data []byte) error
type JSONRPCRequest ¶
type JSONRPCRequest struct {
JSONRPC string `json:"jsonrpc"`
ID RequestID `json:"id"`
Method Method `json:"method"`
Params interface{} `json:"params,omitempty"`
RawParams json.RawMessage `json:"-"`
}
func NewJSONRPCRequest ¶
func NewJSONRPCRequest(id RequestID, method Method, params interface{}) *JSONRPCRequest
NewJSONRPCRequest creates a new JSON-RPC request
func (*JSONRPCRequest) IsValid ¶
func (r *JSONRPCRequest) IsValid() bool
IsValid checks if the request is valid according to JSON-RPC 2.0 spec
func (*JSONRPCRequest) UnmarshalJSON ¶
func (r *JSONRPCRequest) UnmarshalJSON(data []byte) error
type JSONRPCResponse ¶
type JSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID RequestID `json:"id"`
Result interface{} `json:"result,omitempty"`
RawResult json.RawMessage `json:"-"`
Error *responseErr `json:"error,omitempty"`
}
JSONRPCResponse represents a response to a request.
func NewJSONRPCErrorResponse ¶
func NewJSONRPCErrorResponse(id RequestID, code int, message string) *JSONRPCResponse
NewJSONRPCErrorResponse NewError creates a new JSON-RPC error response
func NewJSONRPCSuccessResponse ¶
func NewJSONRPCSuccessResponse(id RequestID, result interface{}) *JSONRPCResponse
NewJSONRPCSuccessResponse creates a new JSON-RPC response
func (*JSONRPCResponse) UnmarshalJSON ¶
func (r *JSONRPCResponse) UnmarshalJSON(data []byte) error
type ListPromptsRequest ¶
type ListPromptsRequest struct{}
ListPromptsRequest represents a request to list available prompts
func NewListPromptsRequest ¶
func NewListPromptsRequest() *ListPromptsRequest
NewListPromptsRequest creates a new list prompts request
type ListPromptsResult ¶
type ListPromptsResult struct {
Prompts []Prompt `json:"prompts"`
NextCursor string `json:"nextCursor,omitempty"`
}
ListPromptsResult represents the response to a list prompts request
func NewListPromptsResult ¶
func NewListPromptsResult(prompts []Prompt, nextCursor string) *ListPromptsResult
NewListPromptsResult creates a new list prompts response
type ListResourceTemplatesRequest ¶
type ListResourceTemplatesRequest struct{}
ListResourceTemplatesRequest represents a request to list resource templates
func NewListResourceTemplatesRequest ¶
func NewListResourceTemplatesRequest() *ListResourceTemplatesRequest
NewListResourceTemplatesRequest creates a new list resource templates request
type ListResourceTemplatesResult ¶
type ListResourceTemplatesResult struct {
ResourceTemplates []ResourceTemplate `json:"resourceTemplates"`
NextCursor string `json:"nextCursor,omitempty"`
}
ListResourceTemplatesResult represents the response to a list resource templates request
func NewListResourceTemplatesResult ¶
func NewListResourceTemplatesResult(templates []ResourceTemplate, nextCursor string) *ListResourceTemplatesResult
NewListResourceTemplatesResult creates a new list resource templates response
type ListResourcesRequest ¶
type ListResourcesRequest struct{}
ListResourcesRequest represents a request to list available resources
func NewListResourcesRequest ¶
func NewListResourcesRequest() *ListResourcesRequest
NewListResourcesRequest creates a new list resources request
type ListResourcesResult ¶
type ListResourcesResult struct {
Resources []Resource `json:"resources"`
NextCursor string `json:"nextCursor,omitempty"`
}
ListResourcesResult represents the response to a list resources request
func NewListResourcesResult ¶
func NewListResourcesResult(resources []Resource, nextCursor string) *ListResourcesResult
NewListResourcesResult creates a new list resources response
type ListRootsRequest ¶
type ListRootsRequest struct{}
ListRootsRequest represents a request to list root directories
func NewListRootsRequest ¶
func NewListRootsRequest() *ListRootsRequest
NewListRootsRequest creates a new list roots request
type ListRootsResult ¶
type ListRootsResult struct {
Roots []Root `json:"roots"`
}
ListRootsResult represents the response to a list roots request
func NewListRootsResult ¶
func NewListRootsResult(roots []Root) *ListRootsResult
NewListRootsResult creates a new list roots response
type ListToolsRequest ¶
type ListToolsRequest struct{}
ListToolsRequest represents a request to list available tools
func NewListToolsRequest ¶
func NewListToolsRequest() *ListToolsRequest
NewListToolsRequest creates a new list tools request
type ListToolsResult ¶
type ListToolsResult struct {
Tools []*Tool `json:"tools"`
NextCursor string `json:"nextCursor,omitempty"`
}
ListToolsResult represents the response to a list tools request
func NewListToolsResult ¶
func NewListToolsResult(tools []*Tool, nextCursor string) *ListToolsResult
NewListToolsResult creates a new list tools response
type LogMessageNotification ¶
type LogMessageNotification struct {
Level LoggingLevel `json:"level"`
Message string `json:"message"`
Meta map[string]interface{} `json:"meta,omitempty"`
}
LogMessageNotification represents a log message notification
func NewLogMessageNotification ¶
func NewLogMessageNotification(level LoggingLevel, message string, meta map[string]interface{}) *LogMessageNotification
NewLogMessageNotification creates a new log message notification
type LoggingLevel ¶
type LoggingLevel string
LoggingLevel represents the severity of a log message
const ( LogEmergency LoggingLevel = "emergency" LogAlert LoggingLevel = "alert" LogCritical LoggingLevel = "critical" LogError LoggingLevel = "error" LogWarning LoggingLevel = "warning" LogNotice LoggingLevel = "notice" LogInfo LoggingLevel = "info" LogDebug LoggingLevel = "debug" )
type Method ¶
type Method string
Method represents the JSON-RPC method name
const ( // Core methods Ping Method = "ping" Initialize Method = "initialize" NotificationInitialized Method = "notifications/initialized" // Root related methods RootsList Method = "roots/list" NotificationRootsListChanged Method = "notifications/roots/list_changed" // Resource related methods ResourcesList Method = "resources/list" ResourceListTemplates Method = "resources/templates/list" ResourcesRead Method = "resources/read" ResourcesSubscribe Method = "resources/subscribe" ResourcesUnsubscribe Method = "resources/unsubscribe" NotificationResourcesListChanged Method = "notifications/resources/list_changed" NotificationResourcesUpdated Method = "notifications/resources/updated" // Tool related methods ToolsList Method = "tools/list" ToolsCall Method = "tools/call" NotificationToolsListChanged Method = "notifications/tools/list_changed" // Prompt related methods PromptsList Method = "prompts/list" PromptsGet Method = "prompts/get" NotificationPromptsListChanged Method = "notifications/prompts/list_changed" // Sampling related methods SamplingCreateMessage Method = "sampling/createMessage" // Logging related methods LoggingSetLevel Method = "logging/setLevel" NotificationLogMessage Method = "notifications/message" // Completion related methods CompletionComplete Method = "completion/complete" // progress related methods NotificationProgress Method = "notifications/progress" NotificationCancelled Method = "notifications/cancelled" )
type ModelHint ¶
type ModelHint struct {
Name string `json:"name,omitempty"`
}
ModelHint represents hints to use for model selection
type ModelPreferences ¶
type ModelPreferences struct {
CostPriority float64 `json:"costPriority,omitempty"`
IntelligencePriority float64 `json:"intelligencePriority,omitempty"`
SpeedPriority float64 `json:"speedPriority,omitempty"`
Hints []ModelHint `json:"hints,omitempty"`
}
ModelPreferences represents the server's preferences for model selection
type PaginatedRequest ¶
type PaginatedRequest struct {
Cursor string `json:"cursor,omitempty"`
}
PaginatedRequest represents a request that supports pagination
type PaginatedResult ¶
type PaginatedResult struct {
NextCursor string `json:"nextCursor,omitempty"`
}
PaginatedResult represents a response that supports pagination
type PingRequest ¶
type PingRequest struct{}
type PingResult ¶
type PingResult struct{}
type ProgressNotification ¶
type ProgressNotification struct {
ProgressToken ProgressToken `json:"progressToken"`
Progress float64 `json:"progress"`
Total float64 `json:"total,omitempty"`
}
ProgressNotification represents a progress notification for a long-running request
func NewProgressNotification ¶
func NewProgressNotification(token ProgressToken, progress float64, total float64) *ProgressNotification
NewProgressNotification creates a new progress notification
type ProgressToken ¶
type ProgressToken interface{} // can be string or integer
ProgressToken represents a token used to associate progress notifications with the original request
type Prompt ¶
type Prompt struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Arguments []PromptArgument `json:"arguments,omitempty"`
}
Prompt related types
type PromptArgument ¶
type PromptListChangedNotification ¶
type PromptListChangedNotification struct {
Meta map[string]interface{} `json:"_meta,omitempty"`
}
PromptListChangedNotification represents a notification that the prompt list has changed
func NewPromptListChangedNotification ¶
func NewPromptListChangedNotification() *PromptListChangedNotification
NewPromptListChangedNotification creates a new prompt list changed notification
type PromptMessage ¶
func (*PromptMessage) UnmarshalJSON ¶
func (m *PromptMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for PromptMessage
type PromptReference ¶
Reference types
type PromptsCapability ¶
type PromptsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type ReadResourceRequest ¶
type ReadResourceRequest struct {
URI string `json:"uri"`
Arguments map[string]interface{} `json:"-"`
}
ReadResourceRequest represents a request to read a specific resource
func NewReadResourceRequest ¶
func NewReadResourceRequest(uri string) *ReadResourceRequest
NewReadResourceRequest creates a new read resource request
type ReadResourceResult ¶
type ReadResourceResult struct {
Contents []ResourceContents `json:"contents"`
}
ReadResourceResult represents the response to a read resource request
func NewReadResourceResult ¶
func NewReadResourceResult(contents []ResourceContents) *ReadResourceResult
NewReadResourceResult creates a new read resource response
func (*ReadResourceResult) UnmarshalJSON ¶
func (r *ReadResourceResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for ReadResourceResult
type Resource ¶
type Resource struct {
Annotated
Name string `json:"name"`
URI string `json:"uri"`
Description string `json:"description,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Size int64 `json:"size,omitempty"`
}
Resource related types
type ResourceContents ¶
type ResourceListChangedNotification ¶
type ResourceListChangedNotification struct {
Meta map[string]interface{} `json:"_meta,omitempty"`
}
ResourceListChangedNotification represents a notification that the resource list has changed
func NewResourceListChangedNotification ¶
func NewResourceListChangedNotification() *ResourceListChangedNotification
NewResourceListChangedNotification creates a new resource list changed notification
type ResourceReference ¶
type ResourceTemplate ¶
type ResourceTemplate struct {
Annotated
Name string `json:"name"`
URITemplate string `json:"uriTemplate"`
URITemplateParsed *uritemplate.Template `json:"-"`
Description string `json:"description,omitempty"`
MimeType string `json:"mimeType,omitempty"`
}
func (*ResourceTemplate) GetURITemplate ¶
func (t *ResourceTemplate) GetURITemplate() *uritemplate.Template
func (*ResourceTemplate) ParseURITemplate ¶
func (t *ResourceTemplate) ParseURITemplate() error
func (*ResourceTemplate) UnmarshalJSON ¶
func (t *ResourceTemplate) UnmarshalJSON(data []byte) error
type ResourceUpdatedNotification ¶
type ResourceUpdatedNotification struct {
URI string `json:"uri"`
}
ResourceUpdatedNotification represents a notification that a resource has been updated
func NewResourceUpdatedNotification ¶
func NewResourceUpdatedNotification(uri string) *ResourceUpdatedNotification
NewResourceUpdatedNotification creates a new resource updated notification
type ResourcesCapability ¶
type Role ¶
type Role string
Role represents the sender or recipient of messages and data in a conversation
type RootsCapability ¶
type RootsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type RootsListChangedNotification ¶
type RootsListChangedNotification struct {
Meta map[string]interface{} `json:"_meta,omitempty"`
}
RootsListChangedNotification represents a notification that the roots list has changed
func NewRootsListChangedNotification ¶
func NewRootsListChangedNotification() *RootsListChangedNotification
NewRootsListChangedNotification creates a new roots list changed notification
type SamplingMessage ¶
type ServerCapabilities ¶
type ServerCapabilities struct {
// Experimental map[string]interface{} `json:"experimental,omitempty"`
// Logging interface{} `json:"logging,omitempty"`
Prompts *PromptsCapability `json:"prompts,omitempty"`
Resources *ResourcesCapability `json:"resources,omitempty"`
Tools *ToolsCapability `json:"tools,omitempty"`
}
type ServerNotify ¶
type ServerNotify interface{}
type ServerRequest ¶
type ServerRequest interface{}
type ServerResponse ¶
type ServerResponse interface{}
type SetLoggingLevelRequest ¶
type SetLoggingLevelRequest struct {
Level LoggingLevel `json:"level"`
}
SetLoggingLevelRequest represents a request to set the logging level
func NewSetLoggingLevelRequest ¶
func NewSetLoggingLevelRequest(level LoggingLevel) *SetLoggingLevelRequest
NewSetLoggingLevelRequest creates a new set logging level request
type SetLoggingLevelResult ¶
type SetLoggingLevelResult struct {
Success bool `json:"success"`
}
SetLoggingLevelResult represents the response to a set logging level request
func NewSetLoggingLevelResult ¶
func NewSetLoggingLevelResult(success bool) *SetLoggingLevelResult
NewSetLoggingLevelResult creates a new set logging level response
type SubscribeRequest ¶
type SubscribeRequest struct {
URI string `json:"uri"`
}
SubscribeRequest represents a request to subscribe to resource updates
func NewSubscribeRequest ¶
func NewSubscribeRequest(uri string) *SubscribeRequest
NewSubscribeRequest creates a new subscribe request
type SubscribeResult ¶
type SubscribeResult struct{}
func NewSubscribeResult ¶
func NewSubscribeResult() *SubscribeResult
type TextContent ¶
func (TextContent) GetType ¶
func (t TextContent) GetType() string
type TextResourceContents ¶
type TextResourceContents struct {
URI string `json:"uri"`
Text string `json:"text"`
MimeType string `json:"mimeType,omitempty"`
}
func (TextResourceContents) GetMimeType ¶
func (t TextResourceContents) GetMimeType() string
func (TextResourceContents) GetURI ¶
func (t TextResourceContents) GetURI() string
type Tool ¶
type Tool struct {
// Name is the unique identifier of the tool
Name string `json:"name"`
// Description is a human-readable description of the tool
Description string `json:"description,omitempty"`
// InputSchema defines the expected parameters for the tool using JSON Schema
InputSchema InputSchema `json:"inputSchema"`
}
Tool represents a tool definition that the client can call
type ToolListChangedNotification ¶
type ToolListChangedNotification struct {
Meta map[string]interface{} `json:"_meta,omitempty"`
}
ToolListChangedNotification represents a notification that the tool list has changed
func NewToolListChangedNotification ¶
func NewToolListChangedNotification() *ToolListChangedNotification
NewToolListChangedNotification creates a new tool list changed notification
type ToolsCapability ¶
type ToolsCapability struct {
ListChanged bool `json:"listChanged,omitempty"`
}
type UnsubscribeRequest ¶
type UnsubscribeRequest struct {
URI string `json:"uri"`
}
UnsubscribeRequest represents a request to unsubscribe from resource updates
func NewUnsubscribeRequest ¶
func NewUnsubscribeRequest(uri string) *UnsubscribeRequest
NewUnsubscribeRequest creates a new unsubscribe request
type UnsubscribeResult ¶
type UnsubscribeResult struct{}
func NewUnsubscribeResult ¶
func NewUnsubscribeResult() *UnsubscribeResult