tools

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountsHandler

func AccountsHandler(ops imap.Operations) server.ToolHandlerFunc

AccountsHandler returns the handler for email_accounts.

func AccountsTool

func AccountsTool() mcp.Tool

AccountsTool returns the email_accounts tool definition.

func AttachmentGetHandler

func AttachmentGetHandler(ops imap.Operations, limits AttachmentLimits) server.ToolHandlerFunc

AttachmentGetHandler returns the handler for email_attachment_get.

func AttachmentGetTool

func AttachmentGetTool() mcp.Tool

AttachmentGetTool returns the email_attachment_get tool definition.

func AttachmentListHandler

func AttachmentListHandler(ops imap.Operations) server.ToolHandlerFunc

AttachmentListHandler returns the handler for email_attachment_list.

func AttachmentListTool

func AttachmentListTool() mcp.Tool

AttachmentListTool returns the email_attachment_list tool definition.

func BatchHandler

func BatchHandler(ops imap.Operations) server.ToolHandlerFunc

BatchHandler returns the handler for email_batch.

func BatchTool

func BatchTool() mcp.Tool

BatchTool returns the email_batch tool definition.

func CopyHandler

func CopyHandler(ops imap.Operations) server.ToolHandlerFunc

CopyHandler returns the handler for email_copy.

func CopyTool

func CopyTool() mcp.Tool

CopyTool returns the email_copy tool definition.

func DeleteHandler

func DeleteHandler(ops imap.Operations) server.ToolHandlerFunc

DeleteHandler returns the handler for email_delete.

func DeleteTool

func DeleteTool() mcp.Tool

DeleteTool returns the email_delete tool definition.

func DraftCreateHandler

func DraftCreateHandler(
	imapOps imap.Operations, smtpOps smtp.Operations, limits AttachmentLimits,
) server.ToolHandlerFunc

DraftCreateHandler returns the handler for email_draft_create.

func DraftCreateTool

func DraftCreateTool() mcp.Tool

DraftCreateTool returns the email_draft_create tool definition.

func DraftSendHandler

func DraftSendHandler(imapOps imap.Operations, smtpOps smtp.Operations) server.ToolHandlerFunc

DraftSendHandler returns the handler for email_draft_send.

func DraftSendTool

func DraftSendTool() mcp.Tool

DraftSendTool returns the email_draft_send tool definition.

func FlagHandler

func FlagHandler(ops imap.Operations) server.ToolHandlerFunc

FlagHandler returns the handler for email_flag.

func FlagTool

func FlagTool() mcp.Tool

FlagTool returns the email_flag tool definition.

func FolderCreateHandler

func FolderCreateHandler(ops imap.Operations) server.ToolHandlerFunc

FolderCreateHandler returns the handler for email_folder_create.

func FolderCreateTool

func FolderCreateTool() mcp.Tool

FolderCreateTool returns the email_folder_create tool definition.

func FoldersHandler

func FoldersHandler(ops imap.Operations) server.ToolHandlerFunc

FoldersHandler returns the handler for email_folders.

func FoldersTool

func FoldersTool() mcp.Tool

FoldersTool returns the email_folders tool definition.

func ForwardHandler

func ForwardHandler(imapOps imap.Operations, smtpOps smtp.Operations, limits AttachmentLimits) server.ToolHandlerFunc

ForwardHandler returns the handler for email_forward.

func ForwardTool

func ForwardTool() mcp.Tool

ForwardTool returns the email_forward tool definition.

func GetHandler

func GetHandler(ops imap.Operations) server.ToolHandlerFunc

GetHandler returns the handler for email_get.

func GetTool

func GetTool() mcp.Tool

GetTool returns the email_get tool definition.

func ListHandler

func ListHandler(ops imap.Operations) server.ToolHandlerFunc

ListHandler returns the handler for email_list.

func ListTool

func ListTool() mcp.Tool

ListTool returns the email_list tool definition.

func MarkReadHandler

func MarkReadHandler(ops imap.Operations) server.ToolHandlerFunc

MarkReadHandler returns the handler for email_mark_read.

func MarkReadTool

func MarkReadTool() mcp.Tool

MarkReadTool returns the email_mark_read tool definition.

func MoveHandler

func MoveHandler(ops imap.Operations) server.ToolHandlerFunc

MoveHandler returns the handler for email_move.

func MoveTool

func MoveTool() mcp.Tool

MoveTool returns the email_move tool definition.

func ReadBodyHandler

func ReadBodyHandler(ops imap.Operations) server.ToolHandlerFunc

ReadBodyHandler returns the handler for email_read_body.

func ReadBodyTool

func ReadBodyTool() mcp.Tool

ReadBodyTool returns the email_read_body tool definition.

func RegisterAll

func RegisterAll(
	s *server.MCPServer, imapOps imap.Operations, smtpOps smtp.Operations, limits AttachmentLimits,
)

RegisterAll registers all email tools with the MCP server.

func ReplyHandler

func ReplyHandler(imapOps imap.Operations, smtpOps smtp.Operations) server.ToolHandlerFunc

ReplyHandler returns the handler for email_reply.

func ReplyTool

func ReplyTool() mcp.Tool

ReplyTool returns the email_reply tool definition.

func SearchHandler

func SearchHandler(ops imap.Operations) server.ToolHandlerFunc

SearchHandler returns the handler for email_search.

func SearchTool

func SearchTool() mcp.Tool

SearchTool returns the email_search tool definition.

func SendHandler

func SendHandler(ops smtp.Operations, limits AttachmentLimits) server.ToolHandlerFunc

SendHandler returns the handler for email_send.

func SendTool

func SendTool() mcp.Tool

SendTool returns the email_send tool definition.

func SplitAddresses

func SplitAddresses(s string) []string

SplitAddresses splits a comma-separated string of email addresses into a trimmed slice, discarding empty entries.

func ThreadHandler

func ThreadHandler(ops imap.Operations) server.ToolHandlerFunc

ThreadHandler returns the handler for email_thread.

func ThreadTool

func ThreadTool() mcp.Tool

ThreadTool returns the email_thread tool definition.

func UnreadHandler

func UnreadHandler(ops imap.Operations) server.ToolHandlerFunc

UnreadHandler returns the handler for email_unread.

func UnreadTool

func UnreadTool() mcp.Tool

UnreadTool returns the email_unread tool definition.

Types

type AttachmentInput

type AttachmentInput struct {
	Path        string `json:"path"`
	Filename    string `json:"filename,omitempty"`
	ContentType string `json:"content_type,omitempty"`
}

AttachmentInput represents a file attachment provided by the caller.

type AttachmentLimits

type AttachmentLimits struct {
	MaxFileSizeBytes     int64
	MaxTotalSizeBytes    int64
	MaxDownloadSizeBytes int64
}

AttachmentLimits holds byte-level attachment size limits derived from config.

func LimitsFromConfig

func LimitsFromConfig(cfg *config.Config) AttachmentLimits

LimitsFromConfig converts MB-based config values to byte-level limits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL