tools

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAll

func RegisterAll(server *mcp.Server, deps *Deps)

Types

type ConfirmExecuteInput

type ConfirmExecuteInput struct {
	DryRunID string `json:"dry_run_id" jsonschema:"the ID returned from a previous dry_run call"`
}

type DatabaseInfo

type DatabaseInfo struct {
	Host   string `json:"host"`
	Name   string `json:"name"`
	Access string `json:"access"`
}

type Deps

type Deps struct {
	Pools   *pgpool.PoolManager
	Access  *access.Checker
	DryRuns *dryrun.Store
	Config  *config.Config
}

type DescribeTableInput

type DescribeTableInput struct {
	Host     string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
	Database string `json:"database" jsonschema:"the database name"`
	Table    string `json:"table" jsonschema:"the table name"`
	Schema   string `json:"schema,omitempty" jsonschema:"schema name (default: public)"`
}

type DryRunInput

type DryRunInput struct {
	Host     string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
	Database string `json:"database" jsonschema:"the database to execute against"`
	SQL      string `json:"sql" jsonschema:"the write query (INSERT/UPDATE/DELETE) or DDL (ALTER/CREATE/DROP) to preview"`
}

type DryRunResult

type DryRunResult struct {
	DryRunID         string   `json:"dry_run_id"`
	Host             string   `json:"host"`
	Kind             string   `json:"kind"`
	Database         string   `json:"database"`
	Tables           []string `json:"tables"`
	EstimatedRows    int64    `json:"estimated_rows"`
	ExplainPlan      string   `json:"explain_plan"`
	Query            string   `json:"query"`
	ExpiresInSeconds int      `json:"expires_in_seconds"`
	Message          string   `json:"message"`
}

type ExecuteResult

type ExecuteResult struct {
	Success      bool   `json:"success"`
	RowsAffected int64  `json:"rows_affected"`
	Host         string `json:"host"`
	Database     string `json:"database"`
	Kind         string `json:"kind"`
	Query        string `json:"query"`
}

type ExplainQueryInput

type ExplainQueryInput struct {
	Host     string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
	Database string `json:"database" jsonschema:"the database to query"`
	SQL      string `json:"sql" jsonschema:"the SQL query to explain"`
}

type HostInfo

type HostInfo struct {
	Name      string `json:"name"`
	Host      string `json:"host"`
	Port      int    `json:"port"`
	Connected bool   `json:"connected"`
	Error     string `json:"error,omitempty"`
}

type ListDatabasesInput

type ListDatabasesInput struct {
	Host string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
}

type ListHostsInput

type ListHostsInput struct{}

type ListTablesInput

type ListTablesInput struct {
	Host     string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
	Database string `json:"database" jsonschema:"the database name"`
	Schema   string `json:"schema,omitempty" jsonschema:"optional schema filter (default: all user schemas)"`
}

type QueryInput

type QueryInput struct {
	Host     string `json:"host,omitempty" jsonschema:"host name from config, omit for default"`
	Database string `json:"database" jsonschema:"the database to query"`
	SQL      string `json:"sql" jsonschema:"SELECT query to execute"`
	Limit    int    `json:"limit,omitempty" jsonschema:"max rows to return (default 100, max 1000)"`
}

type TableDescription

type TableDescription struct {
	Schema      string           `json:"schema"`
	Table       string           `json:"table"`
	Columns     []map[string]any `json:"columns"`
	Indexes     []map[string]any `json:"indexes"`
	ForeignKeys []map[string]any `json:"foreign_keys"`
	Constraints []map[string]any `json:"constraints"`
}

type TableInfo

type TableInfo struct {
	Schema string `json:"schema"`
	Name   string `json:"name"`
	Type   string `json:"type"`
	Access string `json:"access"`
}

Jump to

Keyboard shortcuts

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