tools

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package tools defines tool input/output types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovePolicyInput added in v1.21.0

type ApprovePolicyInput struct {
	PolicyID string `json:"policy_id"`
}

ApprovePolicyInput is the input schema for the approve_policy tool.

type ApprovePolicyResult added in v1.21.0

type ApprovePolicyResult struct {
	PolicyID string `json:"policy_id"`
	Status   string `json:"status"`
}

ApprovePolicyResult is the typed output of an approve_policy tool execution.

func (ApprovePolicyResult) ToMap added in v1.21.0

func (r ApprovePolicyResult) ToMap() map[string]any

ToMap serializes the result for the GraphQL API.

type EntityType added in v1.18.0

type EntityType string

EntityType identifies the kind of entity to show.

const (
	EntityPolicy EntityType = "policy"
)

type ErrorResult

type ErrorResult struct {
	Message string
}

ErrorResult represents a tool execution error.

type QueryInput

type QueryInput struct {
	SQL    string `json:"sql"`
	Status string `json:"status"`
	Result string `json:"result"`
}

QueryInput is the input schema for the query tool.

type QueryResult

type QueryResult struct {
	Rows        []map[string]any `json:"rows"`
	RowsDropped int              `json:"rows_dropped,omitempty"`
}

QueryResult is the typed output of a query tool execution.

func (QueryResult) ToMap

func (r QueryResult) ToMap() map[string]any

ToMap serializes the result for the GraphQL API.

type Result

type Result struct {
	ToolUseID string
	Content   map[string]any // serialized tool result
	Error     *ErrorResult
}

Result holds a tool result with serialized content.

func (Result) IsError

func (r Result) IsError() bool

IsError returns true if this result represents an error.

func (Result) ToMap

func (r Result) ToMap() map[string]any

ToMap serializes the result for the GraphQL API.

type SetServiceEnabledInput added in v1.15.0

type SetServiceEnabledInput struct {
	ServiceID domain.ServiceID `json:"service_id"`
	Enabled   bool             `json:"enabled"`
}

SetServiceEnabledInput is the input schema for the set_service_enabled tool.

type SetServiceEnabledResult added in v1.15.0

type SetServiceEnabledResult struct {
	ServiceID   domain.ServiceID `json:"service_id"`
	ServiceName string           `json:"service_name"`
	Enabled     bool             `json:"enabled"`
}

SetServiceEnabledResult is the typed output of a set_service_enabled tool execution.

func (SetServiceEnabledResult) ToMap added in v1.15.0

func (r SetServiceEnabledResult) ToMap() map[string]any

ToMap serializes the result for the GraphQL API.

type ShowInput added in v1.18.0

type ShowInput struct {
	Entity EntityType `json:"entity"`
	ID     string     `json:"id,omitempty"`
	SQL    string     `json:"sql,omitempty"`
	Title  string     `json:"title,omitempty"`
}

ShowInput is the input schema for the show tool.

type ShowResult added in v1.18.0

type ShowResult struct {
	Entity      EntityType     `json:"entity"`
	ID          string         `json:"id"`
	IDShort     string         `json:"id_short"`
	Title       string         `json:"title,omitempty"`
	CardSummary string         `json:"card_summary"`
	Data        map[string]any `json:"data"`
}

ShowResult is the typed output of a show tool execution.

func (ShowResult) ToMap added in v1.18.0

func (r ShowResult) ToMap() map[string]any

ToMap serializes the result for the GraphQL API. The card_summary tells the AI what the user sees on screen so it can reference the card conversationally without repeating its contents.

Jump to

Keyboard shortcuts

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