tools

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountResourcesFetcher

type AccountResourcesFetcher interface {
	// FetchAccountResources retrieves account information for a specified account name.
	// If accountName is empty, all accessible accounts should be returned.
	FetchAccountResources(ctx context.Context, accountName string) (*mcp.ReadResourceResult, error)
}

AccountResourcesFetcher defines the interface for retrieving account resources. Implementations should provide methods to fetch Firebolt account information.

type Connect

type Connect struct {
	// contains filtered or unexported fields
}

Connect represents a tool for fetching and returning Firebolt resource information. It provides hierarchical access to accounts, databases, and engines in the Firebolt system.

func NewConnect

func NewConnect(
	accountsFetcher AccountResourcesFetcher,
	databasesFetcher DatabaseResourcesFetcher,
	enginesFetcher EngineResourcesFetcher,
	docsProof string,
	disableResources bool,
) *Connect

NewConnect creates a new instance of the Connect tool with the provided resource fetchers. It requires implementations for fetching accounts, databases, and engines.

func (*Connect) Handler

Handler processes tool invocation requests and returns a comprehensive view of Firebolt resources. It fetches accounts and then concurrently retrieves the databases and engines for each account.

func (*Connect) Register added in v0.4.1

func (t *Connect) Register(s *mcp.Server)

Register adds the Connect tool to the provided MCP server instance.

func (*Connect) Tool

func (t *Connect) Tool() *mcp.Tool

Tool returns the mcp.Tool definition for the Connect tool. This defines how the tool is represented in the MCP system.

type ConnectInput added in v0.4.1

type ConnectInput struct {
	DocsProof string `` /* 251-byte string literal not displayed */
}

type ConnectOutput added in v0.4.1

type ConnectOutput struct {
	Results []mcp.Content `json:"results"`
}

type DatabaseResourcesFetcher

type DatabaseResourcesFetcher interface {
	// FetchDatabaseResources retrieves database information for a specified account and database name.
	// If databaseName is empty, all databases in the account should be returned.
	FetchDatabaseResources(ctx context.Context, accountName, databaseName string) (*mcp.ReadResourceResult, error)
}

DatabaseResourcesFetcher defines the interface for retrieving database resources. Implementations should provide methods to fetch Firebolt database information within an account.

type Docs

type Docs struct {
	// contains filtered or unexported fields
}

Docs represents a tool for fetching and returning Firebolt documentation. It provides access to documentation articles that explain Firebolt concepts and functionality.

func NewDocs

func NewDocs(docsFetcher DocsResourcesFetcher, disableResources bool) *Docs

NewDocs creates a new instance of the Docs tool with the provided documentation fetcher. It requires an implementation for fetching documentation articles.

func (*Docs) Handler

func (t *Docs) Handler() mcp.ToolHandlerFor[DocsInput, *DocsOutput]

func (*Docs) Register added in v0.4.1

func (t *Docs) Register(s *mcp.Server)

Register adds the Docs tool to the provided MCP server instance.

func (*Docs) Tool

func (t *Docs) Tool() *mcp.Tool

type DocsInput added in v0.4.1

type DocsInput struct {
	ArticlesIDs []string `json:"articles,omitempty" jsonschema:"Identifiers of the articles to fetch from Firebolt documentation"`
}

type DocsOutput added in v0.4.1

type DocsOutput struct {
	Articles []mcp.Content `json:"articles"`
}

type DocsResourcesFetcher

type DocsResourcesFetcher interface {
	// FetchDocsResources retrieves documentation content for a specified article.
	// If article is empty, the implementation should determine an appropriate default behavior.
	FetchDocsResources(_ context.Context, article string) (*mcp.ReadResourceResult, error)
}

DocsResourcesFetcher defines the interface for retrieving documentation resources. Implementations should provide methods to fetch Firebolt documentation.

type EngineResourcesFetcher

type EngineResourcesFetcher interface {
	// FetchEngineResources retrieves engine information for a specified account and engine name.
	// If engineName is empty, all engines in the account should be returned.
	FetchEngineResources(ctx context.Context, accountName, engineName string) (*mcp.ReadResourceResult, error)
}

EngineResourcesFetcher defines the interface for retrieving engine resources. Implementations should provide methods to fetch Firebolt engine information within an account.

type Query

type Query struct {
	// contains filtered or unexported fields
}

Query represents a tool for executing SQL queries against Firebolt databases. It handles connecting to the appropriate account, database, and engine before executing the query and returning results.

func NewQuery

func NewQuery(dbPool database.Pool) *Query

NewQuery creates a new instance of the Query tool with the provided database connection pool. The connection pool is responsible for managing connections to different Firebolt account/database/engine combinations.

func (*Query) Handler

func (t *Query) Handler() mcp.ToolHandlerFor[QueryInput, *QueryOutput]

Handler processes tool invocation requests and executes SQL queries against Firebolt. It performs the following steps: 1. Extracts and validates required/optional parameters from the request 2. Acquires a database connection from the pool using the specified parameters 3. Executes the query against the database 4. Returns the query results as JSON

func (*Query) Register added in v0.4.1

func (t *Query) Register(s *mcp.Server)

Register adds the Query tool to the provided MCP server instance.

func (*Query) Tool

func (t *Query) Tool() *mcp.Tool

Tool returns the mcp.Tool definition for the Query tool. This defines how the tool is represented in the MCP system, including: - The tool's name and description - Required and optional parameters with their descriptions

type QueryInput added in v0.4.1

type QueryInput struct {
	Query    string `json:"query" jsonschema:"SQL query to execute"`
	Account  string `json:"account" jsonschema:"Name of the Firebolt account to connect to"`
	Database string `` /* 205-byte string literal not displayed */
	Engine   string `` /* 423-byte string literal not displayed */
}

type QueryOutput added in v0.4.1

type QueryOutput struct {
	Result []mcp.Content `json:"result"`
}

Jump to

Keyboard shortcuts

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