mcp

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 25 Imported by: 0 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

View Source
const (
	ServerName = "ghost"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyCreateInput added in v0.27.0

type APIKeyCreateInput struct {
	Name string `json:"name,omitempty"`
}

APIKeyCreateInput represents input for ghost_api_key_create.

func (APIKeyCreateInput) Schema added in v0.27.0

type APIKeyCreateOutput added in v0.27.0

type APIKeyCreateOutput struct {
	Name   string `json:"name"`
	APIKey string `json:"api_key"`
}

APIKeyCreateOutput represents output for ghost_api_key_create. APIKey is the one-time secret — it cannot be retrieved again later.

func (APIKeyCreateOutput) Schema added in v0.27.0

type APIKeyDeleteInput added in v0.27.0

type APIKeyDeleteInput struct {
	Prefix string `json:"prefix"`
}

APIKeyDeleteInput represents input for ghost_api_key_delete.

func (APIKeyDeleteInput) Schema added in v0.27.0

type APIKeyDeleteOutput added in v0.27.0

type APIKeyDeleteOutput struct {
	Success bool   `json:"success"`
	Prefix  string `json:"prefix"`
}

APIKeyDeleteOutput represents output for ghost_api_key_delete.

func (APIKeyDeleteOutput) Schema added in v0.27.0

type APIKeyListInput added in v0.27.0

type APIKeyListInput struct{}

APIKeyListInput represents input for ghost_api_key_list (no parameters).

func (APIKeyListInput) Schema added in v0.27.0

func (APIKeyListInput) Schema() *jsonschema.Schema

type APIKeyListOutput added in v0.27.0

type APIKeyListOutput struct {
	APIKeys []api.APIKey `json:"api_keys"`
}

APIKeyListOutput represents output for ghost_api_key_list. The API's own api.APIKey type is used directly — it exposes only the prefix, name, and creation time, never the secret.

func (APIKeyListOutput) Schema added in v0.27.0

type Capabilities

type Capabilities struct {
	Tools             []*mcp.Tool             `json:"tools"`
	Prompts           []*mcp.Prompt           `json:"prompts"`
	Resources         []*mcp.Resource         `json:"resources"`
	ResourceTemplates []*mcp.ResourceTemplate `json:"resource_templates"`
}

Capabilities holds all MCP server capabilities

func (*Capabilities) Get

func (c *Capabilities) Get(name string) any

Get finds any capability (tool, prompt, resource, or resource template) by name. Returns the capability if found, or nil if not found. Note that if there are duplicate names (e.g. a tool and a prompt with the same name) it will return the first found. We should therefore aim to avoid duplicate capability names.

func (*Capabilities) Names

func (c *Capabilities) Names() []string

type ChartDiagnostic added in v0.24.0

type ChartDiagnostic struct {
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Message  string `json:"message"`
	Severity string `json:"severity"` // "error" | "warning"
}

ChartDiagnostic is one type/syntax issue reported by the editor's language service for a chart config (the same squiggles a human sees in the editor). It is both the browser's wire shape and the type surfaced in structured tool output — the JSON tags happen to match, so no conversion is needed.

type ConnectInput

type ConnectInput struct {
	Ref string `json:"name_or_id"`
}

ConnectInput represents input for ghost_connect

func (ConnectInput) Schema

func (ConnectInput) Schema() *jsonschema.Schema

type ConnectOutput

type ConnectOutput struct {
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

ConnectOutput represents output for ghost_connect

func (ConnectOutput) Schema

func (ConnectOutput) Schema() *jsonschema.Schema

type CreateDedicatedInput

type CreateDedicatedInput struct {
	Name       string `json:"name,omitempty"`
	Size       string `json:"size,omitempty"`
	ShareToken string `json:"share_token,omitempty"`
	Wait       bool   `json:"wait,omitempty"`
}

CreateDedicatedInput represents input for ghost_create_dedicated

func (CreateDedicatedInput) Schema

type CreateDedicatedOutput

type CreateDedicatedOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	Size             string   `json:"size"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

CreateDedicatedOutput represents output for ghost_create_dedicated

func (CreateDedicatedOutput) Schema

type CreateInput

type CreateInput struct {
	Name       string `json:"name,omitempty"`
	ShareToken string `json:"share_token,omitempty"`
	Wait       bool   `json:"wait,omitempty"`
}

CreateInput represents input for ghost_create

func (CreateInput) Schema

func (CreateInput) Schema() *jsonschema.Schema

type CreateOutput

type CreateOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

CreateOutput represents output for ghost_create

func (CreateOutput) Schema

func (CreateOutput) Schema() *jsonschema.Schema

type DatabaseInfo

type DatabaseInfo struct {
	ID             string             `json:"id"`
	Name           string             `json:"name"`
	Type           api.DatabaseType   `json:"type"`
	Size           *api.DatabaseSize  `json:"size,omitempty"`
	Status         api.DatabaseStatus `json:"status"`
	Storage        string             `json:"storage"`
	ComputeMinutes *int64             `json:"compute_minutes,omitempty"`
}

DatabaseInfo represents information about a single database

type DeleteInput

type DeleteInput struct {
	Ref string `json:"name_or_id"`
}

DeleteInput represents input for ghost_delete

func (DeleteInput) Schema

func (DeleteInput) Schema() *jsonschema.Schema

type DeleteOutput

type DeleteOutput struct {
	Success  bool     `json:"success"`
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Warnings []string `json:"warnings,omitempty"`
}

DeleteOutput represents output for ghost_delete

func (DeleteOutput) Schema

func (DeleteOutput) Schema() *jsonschema.Schema

type FeedbackInput

type FeedbackInput struct {
	Message string `json:"message"`
}

FeedbackInput represents input for ghost_feedback

func (FeedbackInput) Schema

func (FeedbackInput) Schema() *jsonschema.Schema

type FeedbackOutput

type FeedbackOutput struct {
	Success bool `json:"success"`
}

FeedbackOutput represents output for ghost_feedback

func (FeedbackOutput) Schema

func (FeedbackOutput) Schema() *jsonschema.Schema

type ForkDedicatedInput

type ForkDedicatedInput struct {
	Ref  string `json:"name_or_id"`
	Name string `json:"name,omitempty"`
	Size string `json:"size,omitempty"`
	Wait bool   `json:"wait,omitempty"`
}

ForkDedicatedInput represents input for ghost_fork_dedicated

func (ForkDedicatedInput) Schema

type ForkDedicatedOutput

type ForkDedicatedOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	Size             string   `json:"size"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

ForkDedicatedOutput represents output for ghost_fork_dedicated

func (ForkDedicatedOutput) Schema

type ForkInput

type ForkInput struct {
	Ref  string `json:"name_or_id"`
	Name string `json:"name,omitempty"`
	Wait bool   `json:"wait,omitempty"`
}

ForkInput represents input for ghost_fork

func (ForkInput) Schema

func (ForkInput) Schema() *jsonschema.Schema

type ForkOutput

type ForkOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

ForkOutput represents output for ghost_fork

func (ForkOutput) Schema

func (ForkOutput) Schema() *jsonschema.Schema

type FunctionToolsMode added in v0.26.0

type FunctionToolsMode int

FunctionToolsMode selects how much of the generated function-tool feature (see internal/mcp/function) a Server turns on. Picking the mode is the caller's responsibility (internal/cmd); this package just acts on it.

This only covers the regular (authoring) server; the stripped consumer serving mode is a wholly separate constructor, NewFunctionToolsServer.

const (
	// FunctionToolsDisabled turns the feature off entirely: no Manager, no
	// ghost_mcp_tool_refresh tool, no generated tools.
	FunctionToolsDisabled FunctionToolsMode = iota
	// FunctionToolsManagementOnly registers the function-tool Manager and
	// the ghost_mcp_tool_refresh management tool, without connecting to any
	// database or registering any generated tools. Used by callers that
	// only enumerate capabilities (`ghost mcp list`/`get`, shell
	// completion), which must not connect to any databases, so their
	// listings stay accurate when the feature is enabled.
	FunctionToolsManagementOnly
	// FunctionToolsEnabled additionally introspects and registers the
	// generated function tools of every database in the space at
	// construction. Set by `ghost mcp start` (without --serve).
	FunctionToolsEnabled
)

type IDInput added in v0.19.0

type IDInput struct{}

IDInput represents input for ghost_id (empty - no parameters)

func (IDInput) Schema added in v0.19.0

func (IDInput) Schema() *jsonschema.Schema

type IDOutput added in v0.19.0

type IDOutput api.AuthInfo

IDOutput is the MCP tool's output type. It has the same underlying type as api.AuthInfo so values convert directly, and is redeclared here so the tool can attach a Schema() method (matching the pattern other MCP tools use).

func (IDOutput) Schema added in v0.19.0

func (IDOutput) Schema() *jsonschema.Schema

type InvoiceInput added in v0.10.0

type InvoiceInput struct {
	InvoiceID string `json:"invoice_id"`
}

InvoiceInput represents input for ghost_invoice.

func (InvoiceInput) Schema added in v0.10.0

func (InvoiceInput) Schema() *jsonschema.Schema

type InvoiceLineItem added in v0.10.0

type InvoiceLineItem struct {
	ProductType  string  `json:"product_type"`
	DatabaseID   string  `json:"database_id,omitempty"`
	DetailedSpec string  `json:"detailed_spec,omitempty"`
	Quantity     float64 `json:"quantity"`
	UnitPrice    float64 `json:"unit_price"`
	LineTotal    float64 `json:"line_total"`
}

InvoiceLineItem represents a single line item on an invoice.

type InvoiceListInput added in v0.10.0

type InvoiceListInput struct{}

InvoiceListInput represents input for ghost_invoice_list (no parameters).

func (InvoiceListInput) Schema added in v0.10.0

type InvoiceListOutput added in v0.10.0

type InvoiceListOutput struct {
	Invoices []InvoiceSummary `json:"invoices"`
}

InvoiceListOutput represents output for ghost_invoice_list.

func (InvoiceListOutput) Schema added in v0.10.0

type InvoiceOutput added in v0.10.0

type InvoiceOutput struct {
	LineItems []InvoiceLineItem `json:"line_items"`
}

InvoiceOutput represents output for ghost_invoice.

func (InvoiceOutput) Schema added in v0.10.0

func (InvoiceOutput) Schema() *jsonschema.Schema

type InvoiceSummary added in v0.10.0

type InvoiceSummary struct {
	ID            string    `json:"id"`
	InvoiceNumber string    `json:"invoice_number"`
	InvoiceDate   time.Time `json:"invoice_date"`
	Total         float64   `json:"total"`
	Status        string    `json:"status"`
}

InvoiceSummary represents a single invoice in the ghost_invoice_list output.

type ListInput

type ListInput struct{}

ListInput represents input for ghost_list (empty - no parameters)

func (ListInput) Schema

func (ListInput) Schema() *jsonschema.Schema

type ListOutput

type ListOutput struct {
	Databases []DatabaseInfo `json:"databases"`
}

ListOutput represents output for ghost_list

func (ListOutput) Schema

func (ListOutput) Schema() *jsonschema.Schema

type LoginInput

type LoginInput struct{}

LoginInput represents input for ghost_login

func (LoginInput) Schema

func (LoginInput) Schema() *jsonschema.Schema

type LoginOutput

type LoginOutput struct {
	Name    string `json:"name"`
	Email   string `json:"email"`
	SpaceID string `json:"space_id"`
}

LoginOutput represents output for ghost_login

func (LoginOutput) Schema

func (LoginOutput) Schema() *jsonschema.Schema

type LogsInput

type LogsInput struct {
	Ref   string    `json:"name_or_id"`
	Tail  int       `json:"tail,omitempty"`
	Until time.Time `json:"until,omitempty"`
}

LogsInput represents input for ghost_logs

func (LogsInput) Schema

func (LogsInput) Schema() *jsonschema.Schema

type LogsOutput

type LogsOutput struct {
	Logs []string `json:"logs"`
}

LogsOutput represents output for ghost_logs

func (LogsOutput) Schema

func (LogsOutput) Schema() *jsonschema.Schema

type MCPToolRefreshInput added in v0.26.0

type MCPToolRefreshInput struct {
	Ref string `json:"name_or_id"`
}

MCPToolRefreshInput represents input for ghost_mcp_tool_refresh

func (MCPToolRefreshInput) Schema added in v0.26.0

type MCPToolRefreshOutput added in v0.26.0

type MCPToolRefreshOutput struct {
	Tools []string `json:"tools"`
}

MCPToolRefreshOutput represents output for ghost_mcp_tool_refresh

func (MCPToolRefreshOutput) Schema added in v0.26.0

type Options added in v0.24.0

type Options struct {
	// Logger receives the server's structured log output. Nil discards it.
	Logger *slog.Logger
	// Local indicates the server is running in local (stdio) mode, where it can
	// open a browser on the user's machine. Enables the visualize/chart/
	// ui_state tools backed by an in-process web UI.
	Local bool
	// FunctionTools selects the function-tool feature's mode; see
	// [FunctionToolsMode].
	FunctionTools FunctionToolsMode
	// WatchConfig starts a background watcher that reconciles the read-only
	// tool set when the config file changes; see startConfigWatcher. Set only
	// by long-running serve entrypoints (`ghost mcp start`); enumeration
	// callers (mcp list/get, completion) leave it false so they neither create
	// the config directory nor spawn a goroutine.
	WatchConfig bool
}

Options configures optional Server behavior.

type PasswordInput

type PasswordInput struct {
	Ref      string `json:"name_or_id"`
	Password string `json:"password,omitempty"`
}

PasswordInput represents input for ghost_password

func (PasswordInput) Schema

func (PasswordInput) Schema() *jsonschema.Schema

type PasswordOutput

type PasswordOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	Password         string   `json:"password"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

PasswordOutput represents output for ghost_password

func (PasswordOutput) Schema

func (PasswordOutput) Schema() *jsonschema.Schema

type PauseInput added in v0.9.0

type PauseInput struct {
	Ref string `json:"name_or_id"`
}

PauseInput represents input for ghost_pause

func (PauseInput) Schema added in v0.9.0

func (PauseInput) Schema() *jsonschema.Schema

type PauseOutput added in v0.9.0

type PauseOutput struct {
	Success bool   `json:"success"`
	ID      string `json:"id"`
	Name    string `json:"name"`
}

PauseOutput represents output for ghost_pause

func (PauseOutput) Schema added in v0.9.0

func (PauseOutput) Schema() *jsonschema.Schema

type PricingInput added in v0.13.0

type PricingInput struct{}

func (PricingInput) Schema added in v0.13.0

func (PricingInput) Schema() *jsonschema.Schema

type PricingOutput added in v0.13.0

type PricingOutput api.Pricing

PricingOutput is the MCP tool's output type. It has the same underlying type as api.Pricing so values convert directly, and is redeclared here so the tool can attach a Schema() method (matching the pattern other MCP tools use).

func (PricingOutput) Schema added in v0.13.0

func (PricingOutput) Schema() *jsonschema.Schema

type ProxyClient

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

ProxyClient manages connection to a remote MCP server and forwards requests

func NewProxyClient

func NewProxyClient(ctx context.Context, url string, logger *slog.Logger) (*ProxyClient, error)

NewProxyClient creates a new proxy client for the given remote server configuration

func (*ProxyClient) Close

func (p *ProxyClient) Close() error

Close closes the connection to the remote MCP server

func (*ProxyClient) RegisterPrompts

func (p *ProxyClient) RegisterPrompts(ctx context.Context, server *mcp.Server) error

RegisterPrompts discovers prompts from remote server and registers them as proxy prompts

func (*ProxyClient) RegisterResourceTemplates

func (p *ProxyClient) RegisterResourceTemplates(ctx context.Context, server *mcp.Server) error

RegisterResourceTemplates discovers resource templates from remote server and registers them as proxy resource templates

func (*ProxyClient) RegisterResources

func (p *ProxyClient) RegisterResources(ctx context.Context, server *mcp.Server) error

RegisterResources discovers resources from remote server and registers them as proxy resources

func (*ProxyClient) RegisterTools

func (p *ProxyClient) RegisterTools(ctx context.Context, server *mcp.Server) error

RegisterTools discovers tools from remote server and registers them as proxy tools

type RenameInput

type RenameInput struct {
	Ref  string `json:"name_or_id"`
	Name string `json:"name"`
}

RenameInput represents input for ghost_rename

func (RenameInput) Schema

func (RenameInput) Schema() *jsonschema.Schema

type RenameOutput

type RenameOutput struct {
	Success bool   `json:"success"`
	ID      string `json:"id"`
	OldName string `json:"old_name"`
	Name    string `json:"name"`
}

RenameOutput represents output for ghost_rename

func (RenameOutput) Schema

func (RenameOutput) Schema() *jsonschema.Schema

type ResumeInput

type ResumeInput struct {
	Ref  string `json:"name_or_id"`
	Wait bool   `json:"wait,omitempty"`
}

ResumeInput represents input for ghost_resume

func (ResumeInput) Schema

func (ResumeInput) Schema() *jsonschema.Schema

type ResumeOutput

type ResumeOutput struct {
	ID               string   `json:"id"`
	Name             string   `json:"name"`
	ConnectionString string   `json:"connection_string"`
	Warnings         []string `json:"warnings,omitempty"`
}

ResumeOutput represents output for ghost_resume

func (ResumeOutput) Schema

func (ResumeOutput) Schema() *jsonschema.Schema

type SQLInput

type SQLInput struct {
	Ref        string   `json:"name_or_id"`
	Query      string   `json:"query,omitempty"`
	File       string   `json:"file,omitempty"`
	Parameters []string `json:"parameters,omitempty"`
}

SQLInput represents input for ghost_sql

func (SQLInput) Schema

func (SQLInput) Schema() *jsonschema.Schema

type SQLOutput

type SQLOutput struct {
	ResultSets    []common.ResultSet `json:"result_sets"`
	ExecutionTime string             `json:"execution_time"`
}

SQLOutput represents output for ghost_sql

func (SQLOutput) Schema

func (SQLOutput) Schema() *jsonschema.Schema

type SchemaInput

type SchemaInput struct {
	Ref         string `json:"name_or_id"`
	SchemaName  string `json:"schema,omitempty"`
	Internal    bool   `json:"internal,omitempty"`
	Definitions bool   `json:"definitions,omitempty"`
	Comments    bool   `json:"comments,omitempty"`
}

SchemaInput represents input for ghost_schema

func (SchemaInput) Schema

func (SchemaInput) Schema() *jsonschema.Schema

type Server

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

Server wraps the MCP server with Ghost-specific functionality

func NewFunctionToolsServer added in v0.26.0

func NewFunctionToolsServer(ctx context.Context, app *common.App, logger *slog.Logger, databaseRef string) (*Server, error)

NewFunctionToolsServer creates a Server in the stripped consumer serving mode: it exposes only the given database's generated function tools — no management tools and no other Ghost tools. This is the artifact you hand to someone as an API. Reached via `ghost mcp start --serve`. Unlike NewServer, a database that can't be introspected is a fatal startup error, since its function tools are the entire tool surface being served.

func NewServer

func NewServer(ctx context.Context, app *common.App, opts Options) (*Server, error)

NewServer creates a new Ghost MCP server instance with the given Options.

func (*Server) Close

func (s *Server) Close() error

Close gracefully shuts down the MCP server and all proxy connections

func (*Server) HTTPHandler

func (s *Server) HTTPHandler() http.Handler

HTTPHandler returns an HTTP handler that implements the streamable HTTP transport. The handler is stateful (sessions are tracked via the Mcp-Session-Id header) so the server can push notifications/tools/list_changed to connected clients when the read_only config changes and the read-only tool set is reconciled (see reconcileReadOnlyTools).

func (*Server) ListCapabilities

func (s *Server) ListCapabilities(ctx context.Context) (*Capabilities, error)

ListCapabilities creates a temporary in-memory client connection to list all capabilities (tools, prompts, resources, and resource templates).

func (*Server) StartStdio

func (s *Server) StartStdio(ctx context.Context) error

StartStdio starts the MCP server with the stdio transport

type ShareInput added in v0.12.0

type ShareInput struct {
	Ref     string `json:"name_or_id"`
	Expires string `json:"expires,omitempty"`
}

ShareInput represents input for ghost_share.

func (ShareInput) Schema added in v0.12.0

func (ShareInput) Schema() *jsonschema.Schema

type ShareListInput added in v0.12.0

type ShareListInput struct{}

ShareListInput represents input for ghost_share_list (no parameters).

func (ShareListInput) Schema added in v0.12.0

func (ShareListInput) Schema() *jsonschema.Schema

type ShareListOutput added in v0.12.0

type ShareListOutput struct {
	Shares []ShareOutput `json:"shares"`
}

ShareListOutput represents output for ghost_share_list.

func (ShareListOutput) Schema added in v0.12.0

func (ShareListOutput) Schema() *jsonschema.Schema

type ShareOutput added in v0.12.0

type ShareOutput struct {
	URL          string     `json:"url"`
	ShareToken   string     `json:"share_token"`
	DatabaseID   string     `json:"database_id"`
	DatabaseName string     `json:"database_name"`
	Status       string     `json:"status"`
	CreatedAt    time.Time  `json:"created_at"`
	ExpiresAt    *time.Time `json:"expires_at,omitempty"`
	RevokedAt    *time.Time `json:"revoked_at,omitempty"`
}

ShareOutput represents a database share in MCP output. The share_token (also embedded in the URL) is the only identifier exposed — it's what a recipient passes to ghost_create, and it's also what you pass back to ghost_share_revoke to revoke the share.

func (ShareOutput) Schema added in v0.12.0

func (ShareOutput) Schema() *jsonschema.Schema

type ShareRevokeInput added in v0.12.0

type ShareRevokeInput struct {
	ShareToken string `json:"share_token"`
}

ShareRevokeInput represents input for ghost_share_revoke.

func (ShareRevokeInput) Schema added in v0.12.0

type UIStateInput added in v0.24.0

type UIStateInput struct {
	Limit int `json:"limit,omitempty"`
}

UIStateInput represents input for ghost_ui_state

func (UIStateInput) Schema added in v0.24.0

func (UIStateInput) Schema() *jsonschema.Schema

type UIStateOutput added in v0.24.0

type UIStateOutput struct {
	SelectedDatabaseID string             `json:"selected_database_id,omitempty"`
	EditorSQL          string             `json:"editor_sql,omitempty"`
	ChartConfig        string             `json:"chart_config,omitempty"`
	ResultView         string             `json:"result_view,omitempty"`
	LastRunStatus      string             `json:"last_run_status,omitempty"`
	LastRunError       string             `json:"last_run_error,omitempty"`
	ResultSets         []common.ResultSet `json:"result_sets,omitempty"`
	ChartError         string             `json:"chart_error,omitempty"`
	ChartDiagnostics   []ChartDiagnostic  `json:"chart_diagnostics,omitempty"`
}

UIStateOutput represents output for ghost_ui_state

func (UIStateOutput) Schema added in v0.24.0

func (UIStateOutput) Schema() *jsonschema.Schema

type UsageInput added in v0.15.0

type UsageInput struct{}

UsageInput represents input for ghost_usage (empty - no parameters)

func (UsageInput) Schema added in v0.15.0

func (UsageInput) Schema() *jsonschema.Schema

type UsageOutput added in v0.15.0

type UsageOutput struct {
	ComputeMinutes      int64                 `json:"compute_minutes"`
	FreeComputeMinutes  int64                 `json:"free_compute_minutes"`
	ComputeLimitMinutes *int64                `json:"compute_limit_minutes"`
	OveragesEnabled     bool                  `json:"overages_enabled"`
	Storage             string                `json:"storage"`
	StorageLimit        string                `json:"storage_limit"`
	Databases           common.DatabaseCounts `json:"databases"`
	CostToDate          *float64              `json:"cost_to_date,omitempty"`
	EstimatedTotalCost  *float64              `json:"estimated_total_cost,omitempty"`
	BillingPeriodStart  *time.Time            `json:"billing_period_start,omitempty"`
	BillingPeriodEnd    *time.Time            `json:"billing_period_end,omitempty"`
}

UsageOutput represents output for ghost_usage

func (UsageOutput) Schema added in v0.15.0

func (UsageOutput) Schema() *jsonschema.Schema

type VisualizeInput added in v0.24.0

type VisualizeInput struct {
	Ref         string `json:"name_or_id,omitempty"`
	SQL         string `json:"sql,omitempty"`
	ChartConfig string `json:"chart_config,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

VisualizeInput represents input for ghost_visualize.

func (VisualizeInput) Schema added in v0.24.0

func (VisualizeInput) Schema() *jsonschema.Schema

type VisualizeOutput added in v0.24.0

type VisualizeOutput struct {
	// ResultSets carries the query results when a query was run (`sql`
	// provided). It is empty when only re-charting the previous run.
	ResultSets       []common.ResultSet `json:"result_sets,omitempty"`
	ChartError       string             `json:"chart_error,omitempty"`
	ChartDiagnostics []ChartDiagnostic  `json:"chart_diagnostics,omitempty"`
}

VisualizeOutput represents output for ghost_visualize. The rendered chart is returned as an image content block (exempt from the structured/text equivalence rule); these fields carry the machine-readable data and feedback.

func (VisualizeOutput) Schema added in v0.24.0

func (VisualizeOutput) Schema() *jsonschema.Schema

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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