tools

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tools provides MCP tool implementations for ChatHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAll

func RegisterAll(rt *runtime.Runtime, store *storage.Storage)

RegisterAll registers all ChatHub tools with the MCP runtime.

Types

type AppendConversationInput

type AppendConversationInput struct {
	Path    string `json:"path" jsonschema:"Path to the existing conversation"`
	Content string `json:"content" jsonschema:"Content to append (Markdown)"`
}

AppendConversationInput is the input for the append_conversation tool.

type AppendConversationOutput

type AppendConversationOutput struct {
	Path         string `json:"path" jsonschema:"Updated file path"`
	MessageCount int    `json:"message_count,omitempty" jsonschema:"Updated message count"`
}

AppendConversationOutput is the output for the append_conversation tool.

func AppendConversation

func AppendConversation(ctx context.Context, store *storage.Storage, input AppendConversationInput) (AppendConversationOutput, error)

AppendConversation appends content to an existing conversation.

type ConversationSummary

type ConversationSummary struct {
	Path        string   `json:"path"`
	Title       string   `json:"title"`
	Date        string   `json:"date"`
	Source      string   `json:"source"`
	Tags        []string `json:"tags,omitempty"`
	Description string   `json:"description,omitempty"`
}

ConversationSummary represents a conversation in list results.

type DeleteConversationInput

type DeleteConversationInput struct {
	Path string `json:"path" jsonschema:"Full path to conversation"`
}

DeleteConversationInput is the input for the delete_conversation tool.

type DeleteConversationOutput

type DeleteConversationOutput struct {
	Deleted bool   `json:"deleted"`
	Message string `json:"message,omitempty"`
}

DeleteConversationOutput is the output for the delete_conversation tool.

func DeleteConversation

func DeleteConversation(ctx context.Context, store *storage.Storage, input DeleteConversationInput) (DeleteConversationOutput, error)

DeleteConversation deletes a conversation from storage.

type ListConversationsInput

type ListConversationsInput struct {
	Source string `json:"source,omitempty" jsonschema:"Filter by source platform"`
	Limit  int    `json:"limit,omitempty" jsonschema:"Max results (default 50)"`
	Offset int    `json:"offset,omitempty" jsonschema:"Pagination offset"`
}

ListConversationsInput is the input for the list_conversations tool.

type ListConversationsOutput

type ListConversationsOutput struct {
	Conversations []ConversationSummary `json:"conversations"`
	Total         int                   `json:"total"`
	HasMore       bool                  `json:"has_more"`
}

ListConversationsOutput is the output for the list_conversations tool.

func ListConversations

func ListConversations(ctx context.Context, store *storage.Storage, input ListConversationsInput) (ListConversationsOutput, error)

ListConversations lists conversations with optional filtering.

type ReadConversationInput

type ReadConversationInput struct {
	Path string `json:"path" jsonschema:"Full path to conversation"`
}

ReadConversationInput is the input for the read_conversation tool.

type ReadConversationOutput

type ReadConversationOutput struct {
	Content     string            `json:"content" jsonschema:"Full Markdown content"`
	Title       string            `json:"title" jsonschema:"Conversation title"`
	Date        string            `json:"date" jsonschema:"Creation date"`
	Source      string            `json:"source" jsonschema:"Source platform"`
	Tags        []string          `json:"tags,omitempty" jsonschema:"Tags"`
	Description string            `json:"description,omitempty" jsonschema:"Brief summary"`
	Metadata    map[string]string `json:"metadata,omitempty" jsonschema:"Additional metadata"`
}

ReadConversationOutput is the output for the read_conversation tool.

func ReadConversation

func ReadConversation(ctx context.Context, store *storage.Storage, input ReadConversationInput) (ReadConversationOutput, error)

ReadConversation reads a conversation from storage.

type SaveConversationInput

type SaveConversationInput struct {
	Title       string   `json:"title" jsonschema:"Conversation title"`
	Content     string   `json:"content" jsonschema:"Full conversation in Markdown"`
	Source      string   `json:"source" jsonschema:"Source platform (chatgpt/claude/gemini/perplexity/codex/claude-code)"`
	Tags        []string `json:"tags,omitempty" jsonschema:"Tags for categorization"`
	Categories  []string `json:"categories,omitempty" jsonschema:"Categories for organization"`
	Description string   `json:"description,omitempty" jsonschema:"Brief summary"`
}

SaveConversationInput is the input for the save_conversation tool.

type SaveConversationOutput

type SaveConversationOutput struct {
	Path           string `json:"path" jsonschema:"Saved file path"`
	ConversationID string `json:"conversation_id" jsonschema:"Unique conversation ID"`
}

SaveConversationOutput is the output for the save_conversation tool.

func SaveConversation

func SaveConversation(ctx context.Context, store *storage.Storage, input SaveConversationInput) (SaveConversationOutput, error)

SaveConversation saves an AI conversation to storage.

type SearchConversationsInput

type SearchConversationsInput struct {
	Query  string `json:"query" jsonschema:"Search query"`
	Source string `json:"source,omitempty" jsonschema:"Filter by source"`
	Limit  int    `json:"limit,omitempty" jsonschema:"Max results (default 20)"`
}

SearchConversationsInput is the input for the search_conversations tool.

type SearchConversationsOutput

type SearchConversationsOutput struct {
	Results []SearchResult `json:"results"`
	Total   int            `json:"total"`
}

SearchConversationsOutput is the output for the search_conversations tool.

func SearchConversations

func SearchConversations(ctx context.Context, store *storage.Storage, input SearchConversationsInput) (SearchConversationsOutput, error)

SearchConversations searches conversations by content or metadata.

type SearchResult

type SearchResult struct {
	Path    string  `json:"path"`
	Title   string  `json:"title"`
	Snippet string  `json:"snippet" jsonschema:"Matching text excerpt"`
	Score   float64 `json:"score" jsonschema:"Relevance score"`
}

SearchResult represents a search result.

Jump to

Keyboard shortcuts

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