Documentation
¶
Index ¶
- Constants
- func ExtractTextResponses(res *mcp.CallToolResult) []string
- type Agent
- func (a *Agent) GetCustomConfig(customConfig interface{}) error
- func (a *Agent) GetSlackClient() *slack.Client
- func (a *Agent) HasEmail() bool
- func (a *Agent) InitializeSlackClient()
- func (a *Agent) LoadConfig(configPath string) error
- func (a *Agent) NewLLM() *gpt.OpenAI
- func (a *Agent) ProcessEmails()
- func (a *Agent) SetTestMode(test bool)
- func (a *Agent) WaitForSignal()
- type Config
- type MCPClient
- type MCPConnectionMethod
- type MCPOptions
- type NotionMCP
Constants ¶
const (
NotionMCPURL = "https://mcp.notion.com/mcp"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractTextResponses ¶
func ExtractTextResponses(res *mcp.CallToolResult) []string
ExtractTextResponses is a helper to convert a CallToolResult’s content to plain text strings when the tool returns textual responses.
Types ¶
type Agent ¶
type Agent struct {
Config *Config
EmailProcessor func(email mail.Email)
SlackProcessor func(event interface{})
MCPClient *MCPClient
// contains filtered or unexported fields
}
func (*Agent) GetCustomConfig ¶
func (*Agent) GetSlackClient ¶
func (*Agent) InitializeSlackClient ¶
func (a *Agent) InitializeSlackClient()
initializeSlackClient creates and starts the Slack client
func (*Agent) LoadConfig ¶
loadConfig reads and parses the YAML configuration file
func (*Agent) ProcessEmails ¶
func (a *Agent) ProcessEmails()
processEmails handles the email processing logic
func (*Agent) SetTestMode ¶
func (*Agent) WaitForSignal ¶
func (a *Agent) WaitForSignal()
type Config ¶
type Config struct {
Slack *struct {
Token string `yaml:"token,omitempty"`
AppToken string `yaml:"app_token,omitempty"`
Channel string `yaml:"channel"`
} `yaml:"slack"`
GPT *struct {
Key string `yaml:"key"`
Model string `yaml:"model"`
} `yaml:"gpt"`
Mail *struct {
Label string `yaml:"label"`
MaxID string `yaml:"maxid,omitempty"`
Wait int `yaml:"wait,omitempty"`
Secret string `yaml:"secret"`
AuthToken string `yaml:"auth_token,omitempty"`
} `yaml:"mail"`
AgentConfig interface{} `yaml:"agent_config,omitempty"`
}
Config represents the YAML configuration structure
type MCPClient ¶
type MCPClient struct {
// contains filtered or unexported fields
}
MCPClient wraps an MCP client session and provides convenience helpers.
func ConnectMCP ¶
func ConnectMCP(ctx context.Context, opts MCPOptions) (*MCPClient, error)
ConnectMCP connects to an MCP server using the provided options and returns a ready session.
func (*MCPClient) CallTool ¶
func (c *MCPClient) CallTool(ctx context.Context, name string, arguments map[string]any) (*mcp.CallToolResult, error)
CallTool invokes a tool by name with the provided arguments. Arguments should match the tool’s JSON Schema.
type MCPConnectionMethod ¶
type MCPConnectionMethod string
MCPConnectionMethod identifies how to connect to an MCP server.
const ( // MethodStreamable connects to a remote MCP server using the Streamable HTTP transport. MethodStreamable MCPConnectionMethod = "streamable" // MethodSSE connects to a remote MCP server using SSE transport. MethodSSE MCPConnectionMethod = "sse" // MethodSTDIO launches a local MCP server process and connects over stdio. MethodSTDIO MCPConnectionMethod = "stdio" )
type MCPOptions ¶
type MCPOptions struct {
// Implementation metadata for the MCP client.
ImplementationName string
ImplementationVersion string
// Method selects the connection approach (remote via npx mcp-remote or stdio).
Method MCPConnectionMethod
// Remote URL (used when MethodRemote). Example: https://mcp.notion.com/mcp
URL string
// Local command and args (used when MethodSTDIO). Example: command="myserver", args=["--flag"]
Command string
Args []string
Env []string
HTTPClient *http.Client
}
MCPOptions configures how to connect to an MCP server.
type NotionMCP ¶
type NotionMCP struct {
NotionKey string
ImplementationName string
ImplementationVersion string
URL string
}
func (*NotionMCP) STDIOStreamable ¶
requires npx in the system to work correctly
func (*NotionMCP) Streamable ¶
not clear this is working correctly... still getting 401 errors