mcptools

package
v0.0.0-...-4b60cfd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEntryHandler

func CreateEntryHandler(store storage.Storage, dataDir string) func(ctx context.Context, req *mcp.CallToolRequest, input CreateEntryInput) (*mcp.CallToolResult, CreateEntryOutput, error)

CreateEntryHandler returns the handler function for the create_entry MCP tool.

func CreateMCPServer

func CreateMCPServer(store storage.Storage, dataDir string) *mcp.Server

CreateMCPServer creates an MCP server with registered diary tools. dataDir is used for cache invalidation after write operations; pass "" to skip.

func FilterHandler

func FilterHandler(store storage.Storage) func(ctx context.Context, req *mcp.CallToolRequest, input FilterInput) (*mcp.CallToolResult, FilterOutput, error)

FilterHandler returns the handler function for the filter_entries MCP tool.

func ListTemplatesHandler

func ListTemplatesHandler(store storage.Storage) func(ctx context.Context, req *mcp.CallToolRequest, input ListTemplatesInput) (*mcp.CallToolResult, ListTemplatesOutput, error)

ListTemplatesHandler returns the handler function for the list_templates MCP tool.

func NewDiaryMCPServer

func NewDiaryMCPServer(store storage.Storage) (*mcp.Server, mcp.Transport)

NewDiaryMCPServer creates an in-memory MCP server exposing diary tools. Returns the server and a client transport for connecting to it.

func SearchHandler

func SearchHandler(store storage.Storage) func(ctx context.Context, req *mcp.CallToolRequest, input SearchInput) (*mcp.CallToolResult, SearchOutput, error)

SearchHandler returns the handler function for the search_entries MCP tool.

Types

type CreateEntryInput

type CreateEntryInput struct {
	Content           string            `json:"content" jsonschema-description:"Entry content"`
	TemplateNames     []string          `json:"template_names,omitempty" jsonschema-description:"Template names to compose"`
	TemplateVariables map[string]string `json:"template_variables,omitempty" jsonschema-description:"Variables for template substitution"`
}

CreateEntryInput is the input schema for the create_entry MCP tool.

type CreateEntryOutput

type CreateEntryOutput struct {
	ID      string `json:"id"`
	Date    string `json:"date"`
	Preview string `json:"preview"`
}

CreateEntryOutput is the output schema for the create_entry MCP tool.

type EntryResult

type EntryResult struct {
	ID      string  `json:"id"`
	Preview string  `json:"preview"`
	Date    string  `json:"date"`
	Score   float64 `json:"score"`
}

EntryResult is the common output format for entry-related MCP tools.

type FilterInput

type FilterInput struct {
	StartDate     string   `json:"start_date,omitempty" jsonschema-description:"ISO date lower bound (inclusive)"`
	EndDate       string   `json:"end_date,omitempty" jsonschema-description:"ISO date upper bound (inclusive)"`
	TemplateNames []string `json:"template_names,omitempty" jsonschema-description:"Filter to entries using these templates"`
	Limit         int      `json:"limit" jsonschema-description:"Maximum number of results"`
}

FilterInput is the input schema for the filter_entries MCP tool.

type FilterOutput

type FilterOutput struct {
	Entries []EntryResult `json:"entries"`
}

FilterOutput is the output schema for the filter_entries MCP tool.

type ListTemplatesInput

type ListTemplatesInput struct {
	Limit int `json:"limit" jsonschema-description:"Maximum number of templates to return"`
}

ListTemplatesInput is the input schema for the list_templates MCP tool.

type ListTemplatesOutput

type ListTemplatesOutput struct {
	Templates []TemplateResult `json:"templates"`
}

ListTemplatesOutput is the output schema for the list_templates MCP tool.

type SearchInput

type SearchInput struct {
	Query string `json:"query" jsonschema-description:"Text to search for in entry content"`
	Limit int    `json:"limit" jsonschema-description:"Maximum number of results to return"`
}

SearchInput is the input schema for the search_entries MCP tool.

type SearchOutput

type SearchOutput struct {
	Entries []EntryResult `json:"entries"`
}

SearchOutput is the output schema for the search_entries MCP tool.

type TemplateResult

type TemplateResult struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Preview string `json:"preview"`
}

TemplateResult represents a template in list_templates output.

Jump to

Keyboard shortcuts

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