Documentation
¶
Index ¶
- Constants
- type Content
- type Options
- type Prompt
- type PromptArgument
- type PromptMessage
- type Resource
- type Server
- func (s *Server) CallTool(ctx context.Context, name string, args map[string]any) (ToolResult, error)
- func (s *Server) GetPrompt(name string, args map[string]any) ([]PromptMessage, error)
- func (s *Server) HandleJSONRPC(ctx context.Context, payload []byte) ([]byte, bool)
- func (s *Server) Prompts() []Prompt
- func (s *Server) ReadResource(uri string) (string, string, error)
- func (s *Server) Resources() []Resource
- func (s *Server) Serve(ctx context.Context, r io.Reader, w io.Writer) error
- func (s *Server) Tools() []Tool
- type Tool
- type ToolResult
Constants ¶
View Source
const ( ProtocolVersion = "2024-11-05" ServerName = "goquent" ServerVersion = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Manifest *manifest.Manifest
Resources []string
Tools []string
Prompts []string
}
Options configures the read-only MCP server.
type Prompt ¶
type Prompt struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Arguments []PromptArgument `json:"arguments,omitempty"`
}
Prompt describes an MCP prompt template.
type PromptArgument ¶
type PromptArgument struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
}
PromptArgument describes a prompt parameter.
type PromptMessage ¶
PromptMessage is returned by prompts/get.
type Resource ¶
type Resource struct {
URI string `json:"uri"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
MimeType string `json:"mimeType,omitempty"`
}
Resource describes an MCP resource.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server exposes Goquent schema, review, and planning helpers through MCP.
func (*Server) CallTool ¶
func (s *Server) CallTool(ctx context.Context, name string, args map[string]any) (ToolResult, error)
CallTool executes a read-only MCP tool.
func (*Server) HandleJSONRPC ¶
HandleJSONRPC handles one JSON-RPC request payload.
func (*Server) ReadResource ¶
ReadResource returns a resource body.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputSchema map[string]any `json:"inputSchema"`
}
Tool describes an MCP tool.
type ToolResult ¶
type ToolResult struct {
Content []Content `json:"content"`
IsError bool `json:"isError,omitempty"`
}
ToolResult is an MCP tool result.
Click to show internal directories.
Click to hide internal directories.