Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
func NewHTTPHandler(version string) *mcp.StreamableHTTPHandler
Types ¶
type DatabasesInput ¶
type DatabasesInput struct {
}
type DatabasesOutput ¶
type DatabasesOutput struct {
Databases []string `json:"databases" jsonschema:"The list of database identifiers.,example=[\"ha.db\", \"test.db\"]"`
}
func Databases ¶
func Databases(ctx context.Context, req *mcp.CallToolRequest, input DatabasesInput) (result *mcp.CallToolResult, output DatabasesOutput, err error)
type HistoryInput ¶ added in v0.15.6
type HistoryOutput ¶ added in v0.15.6
type HistoryOutput struct {
History []haconnect.HistoryItem `json:"history" jsonschema:"List of committed transaction history items."`
}
func History ¶ added in v0.15.6
func History(ctx context.Context, req *mcp.CallToolRequest, input HistoryInput) (result *mcp.CallToolResult, output HistoryOutput, err error)
type QueryInput ¶
type QueryInput struct {
DatabaseID string `json:"database_id" jsonschema:"The identifier of the database to query.,example=ha.db"`
// The query string to be executed.
Query string `json:"query" jsonschema:"The query string to be executed.,example=SELECT * FROM users WHERE active = true"`
// Optional parameters for the query.
Params map[string]any `json:"params,omitempty" jsonschema:"Optional parameters for the query.,example={\"limit\": 10, \"offset\": 0}"`
}
type QueryOutput ¶
type QueryOutput struct {
// The column names of the query result.
Columns []string `json:"columns" jsonschema:"The column names of the query result.,example=[\"id\", \"name\"]"`
// The results of the query.
Results [][]any `json:"results" jsonschema:"The results of the query.,example=[[1, \"Alice\"], [2, \"Bob\"]]"`
}
func Query ¶
func Query(ctx context.Context, req *mcp.CallToolRequest, input QueryInput) (result *mcp.CallToolResult, output QueryOutput, err error)
type SchemaInput ¶ added in v0.15.6
type SchemaInput struct {
DatabaseID string `json:"database_id,omitempty" jsonschema:"The identifier of the database to inspect (empty uses default).,example=ha.db"`
}
type SchemaItem ¶ added in v0.15.6
type SchemaOutput ¶ added in v0.15.6
type SchemaOutput struct {
Items []SchemaItem `json:"items" jsonschema:"Schema objects in the database."`
}
func Schema ¶ added in v0.15.6
func Schema(ctx context.Context, req *mcp.CallToolRequest, input SchemaInput) (result *mcp.CallToolResult, output SchemaOutput, err error)
type UndoInput ¶ added in v0.15.6
type UndoInput struct {
DatabaseID string `json:"database_id,omitempty" jsonschema:"The identifier of the database (empty uses default).,example=ha.db"`
Param string `` /* 131-byte string literal not displayed */
Filter string `json:"filter,omitempty" jsonschema:"Optional undo filter: 'none', 'entity', or 'transaction'.,example=none"`
}
type UndoOutput ¶ added in v0.15.6
type UndoOutput struct {
Status string `json:"status" jsonschema:"Undo result status message."`
}
func Undo ¶ added in v0.15.6
func Undo(ctx context.Context, req *mcp.CallToolRequest, input UndoInput) (result *mcp.CallToolResult, output UndoOutput, err error)
Click to show internal directories.
Click to hide internal directories.