Documentation
¶
Index ¶
- Constants
- type Config
- type ConfigOption
- type InitializeResult
- type ListConversationsInput
- type ListConversationsOutput
- type ReadMessagesInput
- type ReadMessagesOutput
- type Request
- type Response
- type ResponseError
- type SearchMessagesInput
- type SearchMessagesOutput
- type Server
- type ServerCaps
- type ServerInfo
- type ServerOption
- type Tool
- type ToolCallParams
- type ToolCallResult
- type ToolContent
- type ToolRuntime
- type ToolsCapability
- type ToolsListResult
Constants ¶
View Source
const DefaultMaxResults = 50
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ConfigPath string `json:"config_path,omitempty"`
LocalOnly bool `json:"local_only"`
Source string `json:"source"`
MaxResults int `json:"max_results"`
}
func ParseConfig ¶
type ConfigOption ¶
type ConfigOption func(*Config)
func WithSource ¶
func WithSource(source string) ConfigOption
type InitializeResult ¶
type InitializeResult struct {
ProtocolVersion string `json:"protocolVersion"`
ServerInfo ServerInfo `json:"serverInfo"`
Capabilities ServerCaps `json:"capabilities"`
}
type ListConversationsInput ¶
type ListConversationsInput struct {
AccountIDs []string `json:"account_ids,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
UnreadOnly bool `json:"unread_only,omitempty"`
IncludeMuted bool `json:"include_muted,omitempty"`
MutedOnly bool `json:"muted_only,omitempty"`
PinnedOnly bool `json:"pinned_only,omitempty"`
ArchivedOnly bool `json:"archived_only,omitempty"`
Type string `json:"type,omitempty"`
}
type ListConversationsOutput ¶
type ReadMessagesInput ¶
type ReadMessagesOutput ¶
type Request ¶
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id,omitempty"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id,omitempty"`
Result any `json:"result,omitempty"`
Error *ResponseError `json:"error,omitempty"`
}
type ResponseError ¶
type SearchMessagesInput ¶
type SearchMessagesOutput ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(cfg Config, opts ...ServerOption) *Server
func (*Server) CallTool ¶
func (s *Server) CallTool(ctx context.Context, params ToolCallParams) (ToolCallResult, error)
type ServerCaps ¶
type ServerCaps struct {
Tools ToolsCapability `json:"tools"`
}
type ServerInfo ¶
type ServerOption ¶
type ServerOption func(*Server)
func WithContext ¶
func WithContext(ctx context.Context) ServerOption
func WithToolRuntime ¶
func WithToolRuntime(runtime ToolRuntime) ServerOption
type ToolCallParams ¶
type ToolCallParams struct {
Name string `json:"name"`
Arguments json.RawMessage `json:"arguments,omitempty"`
}
type ToolCallResult ¶
type ToolCallResult struct {
Content []ToolContent `json:"content,omitempty"`
IsError bool `json:"isError,omitempty"`
}
type ToolContent ¶
type ToolRuntime ¶
type ToolRuntime interface {
ListConversations(context.Context, ListConversationsInput) (ListConversationsOutput, error)
ReadMessages(context.Context, ReadMessagesInput) (ReadMessagesOutput, error)
SearchMessages(context.Context, SearchMessagesInput) (SearchMessagesOutput, error)
}
type ToolsCapability ¶
type ToolsCapability struct {
ListChanged bool `json:"listChanged"`
}
type ToolsListResult ¶
type ToolsListResult struct {
Tools []Tool `json:"tools"`
}
Click to show internal directories.
Click to hide internal directories.