Documentation
¶
Overview ¶
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Package tools implements the MCP tools that form the core functionality of the server, allowing programmatic interaction with the macOS Mail.app.
Index ¶
- Constants
- func GenerateSchema[T any]() *jsonschema.Schema
- func HandleCreateOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, ...) (*mcp.CallToolResult, any, error)
- func HandleCreateReply(ctx context.Context, request *mcp.CallToolRequest, input CreateReplyInput) (*mcp.CallToolResult, any, error)
- func HandleDeleteDraft(ctx context.Context, request *mcp.CallToolRequest, input DeleteDraftInput) (*mcp.CallToolResult, any, error)
- func HandleDeleteOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, ...) (*mcp.CallToolResult, any, error)
- func HandleFindMessages(ctx context.Context, request *mcp.CallToolRequest, input FindMessagesInput) (*mcp.CallToolResult, any, error)
- func HandleGetMessageContent(ctx context.Context, request *mcp.CallToolRequest, ...) (*mcp.CallToolResult, any, error)
- func HandleGetSelectedMessages(ctx context.Context, request *mcp.CallToolRequest, ...) (*mcp.CallToolResult, any, error)
- func HandleListAccounts(ctx context.Context, request *mcp.CallToolRequest, input ListAccountsInput) (*mcp.CallToolResult, any, error)
- func HandleListDrafts(ctx context.Context, request *mcp.CallToolRequest, input ListDraftsInput) (*mcp.CallToolResult, any, error)
- func HandleListMailboxes(ctx context.Context, request *mcp.CallToolRequest, input ListMailboxesInput) (*mcp.CallToolResult, any, error)
- func HandleListOutgoingMessages(ctx context.Context, request *mcp.CallToolRequest, input struct{}) (*mcp.CallToolResult, any, error)
- func HandleReplaceOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, ...) (*mcp.CallToolResult, any, error)
- func HandleReplaceReply(ctx context.Context, request *mcp.CallToolRequest, input ReplaceReplyInput) (*mcp.CallToolResult, any, error)
- func IsValidContentFormat(format string) bool
- func RegisterAll(srv *mcp.Server)
- func RegisterCreateOutgoingMessage(srv *mcp.Server)
- func RegisterCreateReply(srv *mcp.Server)
- func RegisterDeleteDraft(srv *mcp.Server)
- func RegisterDeleteOutgoingMessage(srv *mcp.Server)
- func RegisterFindMessages(srv *mcp.Server)
- func RegisterGetMessageContent(srv *mcp.Server)
- func RegisterGetSelectedMessages(srv *mcp.Server)
- func RegisterListAccounts(srv *mcp.Server)
- func RegisterListDrafts(srv *mcp.Server)
- func RegisterListMailboxes(srv *mcp.Server)
- func RegisterListOutgoingMessages(srv *mcp.Server)
- func RegisterReplaceOutgoingMessage(srv *mcp.Server)
- func RegisterReplaceReply(srv *mcp.Server)
- func ToClipboardContent(content string, contentFormat string) (htmlContent *string, plainContent string, err error)
- func ValidateAndNormalizeContentFormat(format *string) (string, error)
- type CreateOutgoingMessageInput
- type CreateReplyInput
- type DeleteDraftInput
- type DeleteOutgoingMessageInput
- type FindMessagesInput
- type GetMessageContentInput
- type GetSelectedMessagesInput
- type ListAccountsInput
- type ListDraftsInput
- type ListMailboxesInput
- type ReplaceOutgoingMessageInput
- type ReplaceReplyInput
Constants ¶
const ( ContentFormatPlain = "plain" ContentFormatMarkdown = "markdown" // ContentFormatDefault is the default content format ContentFormatDefault = ContentFormatMarkdown )
ContentFormat constants for email content formatting
Variables ¶
This section is empty.
Functions ¶
func GenerateSchema ¶
func GenerateSchema[T any]() *jsonschema.Schema
GenerateSchema generates a JSON schema for the given type T and fixes nullable fields to be compatible with Gemini API (using "nullable": true instead of type arrays).
func HandleCreateOutgoingMessage ¶
func HandleCreateOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, input CreateOutgoingMessageInput) (*mcp.CallToolResult, any, error)
func HandleCreateReply ¶
func HandleCreateReply(ctx context.Context, request *mcp.CallToolRequest, input CreateReplyInput) (*mcp.CallToolResult, any, error)
func HandleDeleteDraft ¶
func HandleDeleteDraft(ctx context.Context, request *mcp.CallToolRequest, input DeleteDraftInput) (*mcp.CallToolResult, any, error)
func HandleDeleteOutgoingMessage ¶
func HandleDeleteOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, input DeleteOutgoingMessageInput) (*mcp.CallToolResult, any, error)
func HandleFindMessages ¶
func HandleFindMessages(ctx context.Context, request *mcp.CallToolRequest, input FindMessagesInput) (*mcp.CallToolResult, any, error)
func HandleGetMessageContent ¶
func HandleGetMessageContent(ctx context.Context, request *mcp.CallToolRequest, input GetMessageContentInput) (*mcp.CallToolResult, any, error)
func HandleGetSelectedMessages ¶
func HandleGetSelectedMessages(ctx context.Context, request *mcp.CallToolRequest, input GetSelectedMessagesInput) (*mcp.CallToolResult, any, error)
func HandleListAccounts ¶
func HandleListAccounts(ctx context.Context, request *mcp.CallToolRequest, input ListAccountsInput) (*mcp.CallToolResult, any, error)
func HandleListDrafts ¶
func HandleListDrafts(ctx context.Context, request *mcp.CallToolRequest, input ListDraftsInput) (*mcp.CallToolResult, any, error)
func HandleListMailboxes ¶
func HandleListMailboxes(ctx context.Context, request *mcp.CallToolRequest, input ListMailboxesInput) (*mcp.CallToolResult, any, error)
func HandleListOutgoingMessages ¶
func HandleListOutgoingMessages(ctx context.Context, request *mcp.CallToolRequest, input struct{}) (*mcp.CallToolResult, any, error)
func HandleReplaceOutgoingMessage ¶
func HandleReplaceOutgoingMessage(ctx context.Context, request *mcp.CallToolRequest, input ReplaceOutgoingMessageInput) (*mcp.CallToolResult, any, error)
func HandleReplaceReply ¶
func HandleReplaceReply(ctx context.Context, request *mcp.CallToolRequest, input ReplaceReplyInput) (*mcp.CallToolResult, any, error)
func IsValidContentFormat ¶
IsValidContentFormat returns true if the format is supported.
func RegisterAll ¶
RegisterAll registers all available tools with the MCP server.
func RegisterCreateReply ¶
func RegisterDeleteDraft ¶
func RegisterFindMessages ¶
RegisterFindMessages registers the find_messages tool with the MCP server
func RegisterGetMessageContent ¶
RegisterGetMessageContent registers the get_message_content tool with the MCP server
func RegisterGetSelectedMessages ¶
RegisterGetSelectedMessages registers the get_selected_messages tool with the MCP server
func RegisterListAccounts ¶
RegisterListAccounts registers the list_accounts tool with the MCP server
func RegisterListDrafts ¶
RegisterListDrafts registers the list_drafts tool with the MCP server
func RegisterListMailboxes ¶
RegisterListMailboxes registers the list_mailboxes tool with the MCP server
func RegisterListOutgoingMessages ¶
RegisterListOutgoingMessages registers the list_outgoing_messages tool with the MCP server
func RegisterReplaceReply ¶
func ToClipboardContent ¶
func ToClipboardContent(content string, contentFormat string) (htmlContent *string, plainContent string, err error)
ToClipboardContent takes raw content and a format, and returns the HTML content (optional), the plain text content, and an error. If the format is Markdown, the HTML is the rendered Markdown and the plain text is the original Markdown. If the format is Plain, the HTML is nil and the plain text is the raw content.
func ValidateAndNormalizeContentFormat ¶
ValidateAndNormalizeContentFormat checks if the provided format is valid and returns the normalized version. If the input is nil or empty, it returns the default format.
Types ¶
type CreateOutgoingMessageInput ¶
type CreateOutgoingMessageInput struct {
Account string `` /* 130-byte string literal not displayed */
Subject string `json:"subject" jsonschema:"Subject line of the email" long:"subject" description:"Subject line of the email"`
Content string `` /* 156-byte string literal not displayed */
ContentFormat *string `` /* 204-byte string literal not displayed */
ToRecipients *[]string `` /* 156-byte string literal not displayed */
CcRecipients *[]string `` /* 156-byte string literal not displayed */
BccRecipients *[]string `` /* 160-byte string literal not displayed */
}
type CreateReplyInput ¶
type CreateReplyInput struct {
MessageID int `` /* 130-byte string literal not displayed */
Account string `` /* 158-byte string literal not displayed */
MailboxPath []string `` /* 276-byte string literal not displayed */
Content string `` /* 184-byte string literal not displayed */
ContentFormat *string `` /* 204-byte string literal not displayed */
ReplyToAll bool `` /* 162-byte string literal not displayed */
}
type DeleteDraftInput ¶
type DeleteDraftInput struct {
DraftID int `json:"draft_id" jsonschema:"The ID of the draft to delete" long:"draft-id" description:"The ID of the draft to delete"`
}
type DeleteOutgoingMessageInput ¶
type DeleteOutgoingMessageInput struct {
OutgoingID int `` /* 146-byte string literal not displayed */
}
type FindMessagesInput ¶
type FindMessagesInput struct {
Account string `json:"account" jsonschema:"Name of the email account" long:"account" description:"Name of the email account"`
MailboxPath []string `` /* 275-byte string literal not displayed */
Subject string `` /* 138-byte string literal not displayed */
Sender string `` /* 162-byte string literal not displayed */
ReadStatus *bool `` /* 185-byte string literal not displayed */
FlaggedOnly bool `` /* 141-byte string literal not displayed */
DateAfter string `` /* 231-byte string literal not displayed */
DateBefore string `` /* 235-byte string literal not displayed */
Limit int `` /* 180-byte string literal not displayed */
}
FindMessagesInput defines input parameters for find_messages tool
type GetMessageContentInput ¶
type GetMessageContentInput struct {
Account string `json:"account" jsonschema:"Name of the email account" long:"account" description:"Name of the email account"`
MailboxPath []string `` /* 335-byte string literal not displayed */
MessageID int `` /* 144-byte string literal not displayed */
}
GetMessageContentInput defines input parameters for get_message_content tool
type GetSelectedMessagesInput ¶
type GetSelectedMessagesInput struct {
Limit int `` /* 174-byte string literal not displayed */
}
GetSelectedMessagesInput defines input parameters for get_selected_messages tool
type ListAccountsInput ¶
type ListAccountsInput struct {
Enabled bool `json:"enabled" long:"enabled" description:"Filter by enabled status"`
}
ListAccountsInput defines input parameters for list_accounts tool
type ListDraftsInput ¶
type ListDraftsInput struct {
Account string `` /* 178-byte string literal not displayed */
Limit int `` /* 176-byte string literal not displayed */
}
ListDraftsInput defines input parameters for list_drafts tool
type ListMailboxesInput ¶
type ListMailboxesInput struct {
Account string `json:"account" jsonschema:"Name of the email account" long:"account" description:"Name of the email account"`
MailboxPath []string `` /* 402-byte string literal not displayed */
}
ListMailboxesInput defines input parameters for list_mailboxes tool
type ReplaceOutgoingMessageInput ¶
type ReplaceOutgoingMessageInput struct {
OutgoingID int `` /* 148-byte string literal not displayed */
Subject *string `` /* 170-byte string literal not displayed */
Content string `` /* 164-byte string literal not displayed */
ContentFormat *string `` /* 204-byte string literal not displayed */
ToRecipients *[]string `` /* 280-byte string literal not displayed */
CcRecipients *[]string `` /* 280-byte string literal not displayed */
BccRecipients *[]string `` /* 284-byte string literal not displayed */
Sender *string `` /* 184-byte string literal not displayed */
}
type ReplaceReplyInput ¶
type ReplaceReplyInput struct {
OutgoingID int `` /* 160-byte string literal not displayed */
MessageID int `` /* 148-byte string literal not displayed */
Account string `` /* 128-byte string literal not displayed */
MailboxPath []string `` /* 182-byte string literal not displayed */
Content string `` /* 192-byte string literal not displayed */
ContentFormat *string `` /* 204-byte string literal not displayed */
ReplyToAll bool `` /* 162-byte string literal not displayed */
// Optional overrides for the new reply
Subject *string `` /* 170-byte string literal not displayed */
ToRecipients *[]string `` /* 240-byte string literal not displayed */
CcRecipients *[]string `` /* 240-byte string literal not displayed */
BccRecipients *[]string `` /* 244-byte string literal not displayed */
}