tool_query

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input 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 Output

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

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[Input, *Output]

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

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

Jump to

Keyboard shortcuts

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