Documentation
¶
Index ¶
- func GetGoogleIDToken(ctx context.Context, audience string) (string, error)
- func GetSupportedMcpVersions() []string
- func NewCustomTokenSource(provider func() string) oauth2.TokenSource
- type ClientOption
- func WithClientHeaderString(headerName string, value string) ClientOption
- func WithClientHeaderTokenSource(headerName string, value oauth2.TokenSource) ClientOption
- func WithClientName(name string) ClientOption
- func WithClientVersion(version string) ClientOption
- func WithDefaultToolOptions(opts ...ToolOption) ClientOption
- func WithHTTPClient(client *http.Client) ClientOption
- func WithProtocol(p Protocol) ClientOption
- func WithSupportedProtocols(protocols []Protocol) ClientOption
- type Float
- type Integer
- type ManifestSchema
- type ParameterSchema
- type Protocol
- type ToolConfig
- type ToolOption
- func WithAuthTokenSource(authSourceName string, idToken oauth2.TokenSource) ToolOption
- func WithAuthTokenString(authSourceName string, idToken string) ToolOption
- func WithBindParamAnyMap(name string, value map[string]any) ToolOption
- func WithBindParamAnyMapFunc(name string, fn func() (map[string]any, error)) ToolOption
- func WithBindParamBool(name string, value bool) ToolOption
- func WithBindParamBoolArray(name string, value []bool) ToolOption
- func WithBindParamBoolArrayFunc(name string, fn func() ([]bool, error)) ToolOption
- func WithBindParamBoolFunc(name string, fn func() (bool, error)) ToolOption
- func WithBindParamBoolMap(name string, value map[string]bool) ToolOption
- func WithBindParamBoolMapFunc(name string, fn func() (map[string]bool, error)) ToolOption
- func WithBindParamFloat[T Float](name string, value T) ToolOption
- func WithBindParamFloatArray[T Float](name string, value []T) ToolOption
- func WithBindParamFloatArrayFunc[T Float](name string, fn func() ([]T, error)) ToolOption
- func WithBindParamFloatFunc[T Float](name string, fn func() (T, error)) ToolOption
- func WithBindParamFloatMap[T Float](name string, value map[string]T) ToolOption
- func WithBindParamFloatMapFunc[T Float](name string, fn func() (map[string]T, error)) ToolOption
- func WithBindParamInt[T Integer](name string, value T) ToolOption
- func WithBindParamIntArray[T Integer](name string, value []T) ToolOption
- func WithBindParamIntArrayFunc[T Integer](name string, fn func() ([]T, error)) ToolOption
- func WithBindParamIntFunc[T Integer](name string, fn func() (T, error)) ToolOption
- func WithBindParamIntMap[T Integer](name string, value map[string]T) ToolOption
- func WithBindParamIntMapFunc[T Integer](name string, fn func() (map[string]T, error)) ToolOption
- func WithBindParamString(name string, value string) ToolOption
- func WithBindParamStringArray(name string, value []string) ToolOption
- func WithBindParamStringArrayFunc(name string, fn func() ([]string, error)) ToolOption
- func WithBindParamStringFunc(name string, fn func() (string, error)) ToolOption
- func WithBindParamStringMap(name string, value map[string]string) ToolOption
- func WithBindParamStringMapFunc(name string, fn func() (map[string]string, error)) ToolOption
- func WithBindSecureParamAnyMap(name string, value map[string]any) ToolOption
- func WithBindSecureParamAnyMapFunc(name string, fn func() (map[string]any, error)) ToolOption
- func WithBindSecureParamBool(name string, value bool) ToolOption
- func WithBindSecureParamBoolArray(name string, value []bool) ToolOption
- func WithBindSecureParamBoolArrayFunc(name string, fn func() ([]bool, error)) ToolOption
- func WithBindSecureParamBoolFunc(name string, fn func() (bool, error)) ToolOption
- func WithBindSecureParamBoolMap(name string, value map[string]bool) ToolOption
- func WithBindSecureParamBoolMapFunc(name string, fn func() (map[string]bool, error)) ToolOption
- func WithBindSecureParamFloat[T Float](name string, value T) ToolOption
- func WithBindSecureParamFloatArray[T Float](name string, value []T) ToolOption
- func WithBindSecureParamFloatArrayFunc[T Float](name string, fn func() ([]T, error)) ToolOption
- func WithBindSecureParamFloatFunc[T Float](name string, fn func() (T, error)) ToolOption
- func WithBindSecureParamFloatMap[T Float](name string, value map[string]T) ToolOption
- func WithBindSecureParamFloatMapFunc[T Float](name string, fn func() (map[string]T, error)) ToolOption
- func WithBindSecureParamInt[T Integer](name string, value T) ToolOption
- func WithBindSecureParamIntArray[T Integer](name string, value []T) ToolOption
- func WithBindSecureParamIntArrayFunc[T Integer](name string, fn func() ([]T, error)) ToolOption
- func WithBindSecureParamIntFunc[T Integer](name string, fn func() (T, error)) ToolOption
- func WithBindSecureParamIntMap[T Integer](name string, value map[string]T) ToolOption
- func WithBindSecureParamIntMapFunc[T Integer](name string, fn func() (map[string]T, error)) ToolOption
- func WithBindSecureParamString(name string, value string) ToolOption
- func WithBindSecureParamStringArray(name string, value []string) ToolOption
- func WithBindSecureParamStringArrayFunc(name string, fn func() ([]string, error)) ToolOption
- func WithBindSecureParamStringFunc(name string, fn func() (string, error)) ToolOption
- func WithBindSecureParamStringMap(name string, value map[string]string) ToolOption
- func WithBindSecureParamStringMapFunc(name string, fn func() (map[string]string, error)) ToolOption
- func WithStrict(strict bool) ToolOption
- type ToolSchema
- type ToolboxClient
- type ToolboxTool
- func (tt *ToolboxTool) DescribeParameters() string
- func (tt *ToolboxTool) Description() string
- func (tt *ToolboxTool) InputSchema() ([]byte, error)
- func (tt *ToolboxTool) Invoke(ctx context.Context, input map[string]any) (any, error)
- func (tt *ToolboxTool) Name() string
- func (tt *ToolboxTool) Parameters() []ParameterSchema
- func (tt *ToolboxTool) SecureParameters() []ParameterSchema
- func (tt *ToolboxTool) ToolFrom(opts ...ToolOption) (*ToolboxTool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGoogleIDToken ¶
GetGoogleIDToken fetches a Google ID token for a specific audience.
Inputs:
- ctx: The context for the request, which can be used for cancellation or deadlines.
- audience: The recipient of the token, typically the URL of the secured service
Returns:
A string in the format "Bearer <token>" on success, or an error if the token could not be fetched.
func GetSupportedMcpVersions ¶
func GetSupportedMcpVersions() []string
GetSupportedMcpVersions returns a list of supported MCP protocol versions.
func NewCustomTokenSource ¶
func NewCustomTokenSource(provider func() string) oauth2.TokenSource
This function converts a custom function that returns a string into an oauth2.TokenSource type.
Inputs:
- provider: A custom function that returns a token as a string.
Returns:
- An oauth2.TokenSource that wraps the custom function.
Types ¶
type ClientOption ¶
type ClientOption func(*ToolboxClient) error
ClientOption configures a ToolboxClient at creation time.
func WithClientHeaderString ¶
func WithClientHeaderString(headerName string, value string) ClientOption
WithClientHeaderString adds a static string value as a client-wide HTTP header.
func WithClientHeaderTokenSource ¶
func WithClientHeaderTokenSource(headerName string, value oauth2.TokenSource) ClientOption
WithClientHeaderTokenSource adds a dynamic client-wide HTTP header from a TokenSource.
func WithClientName ¶
func WithClientName(name string) ClientOption
WithClientName sets the client name used in the MCP protocol handshake. Defaults to "toolbox-core-go" if not set.
func WithClientVersion ¶ added in v0.7.0
func WithClientVersion(version string) ClientOption
WithClientVersion sets the client version used in the MCP protocol handshake. Defaults to the core SDK version if not set.
func WithDefaultToolOptions ¶
func WithDefaultToolOptions(opts ...ToolOption) ClientOption
WithDefaultToolOptions provides default Options that will be applied to every tool loaded by this client.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient provides a custom http.Client to the ToolboxClient.
func WithProtocol ¶
func WithProtocol(p Protocol) ClientOption
WithProtocol provides a the underlying transport protocol to the ToolboxClient..
func WithSupportedProtocols ¶ added in v1.1.0
func WithSupportedProtocols(protocols []Protocol) ClientOption
WithSupportedProtocols configures a user-defined list of supported protocols for auto-negotiation. The provided protocols are prioritized from newest to oldest version.
type ManifestSchema ¶
type ManifestSchema = transport.ManifestSchema
type ParameterSchema ¶
type ParameterSchema = transport.ParameterSchema
ParameterSchema defines the structure and validation logic for tool parameters.
type Protocol ¶
type Protocol string
Protocol defines underlying transport protocols.
const ( // MCP Version Constants MCPv20260728 Protocol = transport.MCPv20260728 MCPv20251125 Protocol = transport.MCPv20251125 MCPv20250618 Protocol = transport.MCPv20250618 MCPv20250326 Protocol = transport.MCPv20250326 MCPv20241105 Protocol = transport.MCPv20241105 // MCP is the default alias pointing to the newest supported version. MCP = MCPv20260728 MCPLatest Protocol = MCPv20260728 MCPDraft Protocol = MCPv20260728 ExtensionSecureParams = transport.ExtensionSecureParams )
type ToolConfig ¶
type ToolConfig struct {
AuthTokenSources map[string]oauth2.TokenSource
BoundParams map[string]any
SecureParams map[string]any
Strict bool
// contains filtered or unexported fields
}
ToolConfig holds all configurable aspects for creating or deriving a tool.
type ToolOption ¶
type ToolOption func(*ToolConfig) error
ToolOption defines a single, universal type for a functional option that configures a tool.
func WithAuthTokenSource ¶
func WithAuthTokenSource(authSourceName string, idToken oauth2.TokenSource) ToolOption
WithAuthTokenSource provides an authentication token from a standard TokenSource.
func WithAuthTokenString ¶
func WithAuthTokenString(authSourceName string, idToken string) ToolOption
WithAuthTokenString provides a static string authentication token.
func WithBindParamAnyMap ¶ added in v0.7.0
func WithBindParamAnyMap(name string, value map[string]any) ToolOption
WithBindParamAnyMap binds a generic map to a parameter.
func WithBindParamAnyMapFunc ¶ added in v0.7.0
func WithBindParamAnyMapFunc(name string, fn func() (map[string]any, error)) ToolOption
WithBindParamAnyMapFunc binds a function that returns a generic map to a parameter.
func WithBindParamBool ¶
func WithBindParamBool(name string, value bool) ToolOption
WithBindParamBool binds a static boolean value to a parameter.
func WithBindParamBoolArray ¶
func WithBindParamBoolArray(name string, value []bool) ToolOption
WithBindParamBoolArray binds a static slice of booleans to a parameter.
func WithBindParamBoolArrayFunc ¶
func WithBindParamBoolArrayFunc(name string, fn func() ([]bool, error)) ToolOption
WithBindParamBoolArrayFunc binds a function that returns a slice of booleans.
func WithBindParamBoolFunc ¶
func WithBindParamBoolFunc(name string, fn func() (bool, error)) ToolOption
WithBindParamBoolFunc binds a function that returns a boolean to a parameter.
func WithBindParamBoolMap ¶ added in v0.7.0
func WithBindParamBoolMap(name string, value map[string]bool) ToolOption
WithBindParamBoolMap binds a static map of booleans to a parameter.
func WithBindParamBoolMapFunc ¶ added in v0.7.0
func WithBindParamBoolMapFunc(name string, fn func() (map[string]bool, error)) ToolOption
WithBindParamBoolMapFunc binds a function that returns a map of booleans to a parameter.
func WithBindParamFloat ¶
func WithBindParamFloat[T Float](name string, value T) ToolOption
WithBindParamFloat binds a static float value to a parameter.
func WithBindParamFloatArray ¶
func WithBindParamFloatArray[T Float](name string, value []T) ToolOption
WithBindParamFloatArray binds a static slice of floats to a parameter.
func WithBindParamFloatArrayFunc ¶
func WithBindParamFloatArrayFunc[T Float](name string, fn func() ([]T, error)) ToolOption
WithBindParamFloatArrayFunc binds a function that returns a slice of floats.
func WithBindParamFloatFunc ¶
func WithBindParamFloatFunc[T Float](name string, fn func() (T, error)) ToolOption
WithBindParamFloatFunc binds a function that returns a float to a parameter.
func WithBindParamFloatMap ¶ added in v0.7.0
func WithBindParamFloatMap[T Float](name string, value map[string]T) ToolOption
WithBindParamFloatMap binds a static map of floats to a parameter.
func WithBindParamFloatMapFunc ¶ added in v0.7.0
func WithBindParamFloatMapFunc[T Float](name string, fn func() (map[string]T, error)) ToolOption
WithBindParamFloatMapFunc binds a function that returns a map of floats to a parameter.
func WithBindParamInt ¶
func WithBindParamInt[T Integer](name string, value T) ToolOption
WithBindParamInt binds a static integer value to a parameter.
func WithBindParamIntArray ¶
func WithBindParamIntArray[T Integer](name string, value []T) ToolOption
WithBindParamIntArray binds a static slice of integers to a parameter.
func WithBindParamIntArrayFunc ¶
func WithBindParamIntArrayFunc[T Integer](name string, fn func() ([]T, error)) ToolOption
WithBindParamIntArrayFunc binds a function that returns a slice of integers.
func WithBindParamIntFunc ¶
func WithBindParamIntFunc[T Integer](name string, fn func() (T, error)) ToolOption
WithBindParamIntFunc binds a function that returns an integer to a parameter.
func WithBindParamIntMap ¶ added in v0.7.0
func WithBindParamIntMap[T Integer](name string, value map[string]T) ToolOption
WithBindParamIntMap binds a static map of integers to a parameter.
func WithBindParamIntMapFunc ¶ added in v0.7.0
func WithBindParamIntMapFunc[T Integer](name string, fn func() (map[string]T, error)) ToolOption
WithBindParamIntMapFunc binds a function that returns a map of integers to a parameter.
func WithBindParamString ¶
func WithBindParamString(name string, value string) ToolOption
WithBindParamString binds a static string value to a parameter.
func WithBindParamStringArray ¶
func WithBindParamStringArray(name string, value []string) ToolOption
WithBindParamStringArray binds a static slice of strings to a parameter.
func WithBindParamStringArrayFunc ¶
func WithBindParamStringArrayFunc(name string, fn func() ([]string, error)) ToolOption
WithBindParamStringArrayFunc binds a function that returns a slice of strings.
func WithBindParamStringFunc ¶
func WithBindParamStringFunc(name string, fn func() (string, error)) ToolOption
WithBindParamStringFunc binds a function that returns a string to a parameter.
func WithBindParamStringMap ¶ added in v0.7.0
func WithBindParamStringMap(name string, value map[string]string) ToolOption
WithBindParamStringMap binds a static map of strings to a parameter.
func WithBindParamStringMapFunc ¶ added in v0.7.0
func WithBindParamStringMapFunc(name string, fn func() (map[string]string, error)) ToolOption
WithBindParamStringMapFunc binds a function that returns a map of strings to a parameter.
func WithBindSecureParamAnyMap ¶ added in v1.2.0
func WithBindSecureParamAnyMap(name string, value map[string]any) ToolOption
WithBindSecureParamAnyMap binds a generic map to a secure parameter.
func WithBindSecureParamAnyMapFunc ¶ added in v1.2.0
func WithBindSecureParamAnyMapFunc(name string, fn func() (map[string]any, error)) ToolOption
WithBindSecureParamAnyMapFunc binds a function that returns a generic map to a secure parameter.
func WithBindSecureParamBool ¶ added in v1.2.0
func WithBindSecureParamBool(name string, value bool) ToolOption
WithBindSecureParamBool binds a static boolean value to a secure parameter.
func WithBindSecureParamBoolArray ¶ added in v1.2.0
func WithBindSecureParamBoolArray(name string, value []bool) ToolOption
WithBindSecureParamBoolArray binds a static slice of booleans to a secure parameter.
func WithBindSecureParamBoolArrayFunc ¶ added in v1.2.0
func WithBindSecureParamBoolArrayFunc(name string, fn func() ([]bool, error)) ToolOption
WithBindSecureParamBoolArrayFunc binds a function that returns a slice of booleans to a secure parameter.
func WithBindSecureParamBoolFunc ¶ added in v1.2.0
func WithBindSecureParamBoolFunc(name string, fn func() (bool, error)) ToolOption
WithBindSecureParamBoolFunc binds a function that returns a boolean to a secure parameter.
func WithBindSecureParamBoolMap ¶ added in v1.2.0
func WithBindSecureParamBoolMap(name string, value map[string]bool) ToolOption
WithBindSecureParamBoolMap binds a static map of booleans to a secure parameter.
func WithBindSecureParamBoolMapFunc ¶ added in v1.2.0
func WithBindSecureParamBoolMapFunc(name string, fn func() (map[string]bool, error)) ToolOption
WithBindSecureParamBoolMapFunc binds a function that returns a map of booleans to a secure parameter.
func WithBindSecureParamFloat ¶ added in v1.2.0
func WithBindSecureParamFloat[T Float](name string, value T) ToolOption
WithBindSecureParamFloat binds a static float value to a secure parameter.
func WithBindSecureParamFloatArray ¶ added in v1.2.0
func WithBindSecureParamFloatArray[T Float](name string, value []T) ToolOption
WithBindSecureParamFloatArray binds a static slice of floats to a secure parameter.
func WithBindSecureParamFloatArrayFunc ¶ added in v1.2.0
func WithBindSecureParamFloatArrayFunc[T Float](name string, fn func() ([]T, error)) ToolOption
WithBindSecureParamFloatArrayFunc binds a function that returns a slice of floats to a secure parameter.
func WithBindSecureParamFloatFunc ¶ added in v1.2.0
func WithBindSecureParamFloatFunc[T Float](name string, fn func() (T, error)) ToolOption
WithBindSecureParamFloatFunc binds a function that returns a float to a secure parameter.
func WithBindSecureParamFloatMap ¶ added in v1.2.0
func WithBindSecureParamFloatMap[T Float](name string, value map[string]T) ToolOption
WithBindSecureParamFloatMap binds a static map of floats to a secure parameter.
func WithBindSecureParamFloatMapFunc ¶ added in v1.2.0
func WithBindSecureParamFloatMapFunc[T Float](name string, fn func() (map[string]T, error)) ToolOption
WithBindSecureParamFloatMapFunc binds a function that returns a map of floats to a secure parameter.
func WithBindSecureParamInt ¶ added in v1.2.0
func WithBindSecureParamInt[T Integer](name string, value T) ToolOption
WithBindSecureParamInt binds a static integer value to a secure parameter.
func WithBindSecureParamIntArray ¶ added in v1.2.0
func WithBindSecureParamIntArray[T Integer](name string, value []T) ToolOption
WithBindSecureParamIntArray binds a static slice of integers to a secure parameter.
func WithBindSecureParamIntArrayFunc ¶ added in v1.2.0
func WithBindSecureParamIntArrayFunc[T Integer](name string, fn func() ([]T, error)) ToolOption
WithBindSecureParamIntArrayFunc binds a function that returns a slice of integers to a secure parameter.
func WithBindSecureParamIntFunc ¶ added in v1.2.0
func WithBindSecureParamIntFunc[T Integer](name string, fn func() (T, error)) ToolOption
WithBindSecureParamIntFunc binds a function that returns an integer to a secure parameter.
func WithBindSecureParamIntMap ¶ added in v1.2.0
func WithBindSecureParamIntMap[T Integer](name string, value map[string]T) ToolOption
WithBindSecureParamIntMap binds a static map of integers to a secure parameter.
func WithBindSecureParamIntMapFunc ¶ added in v1.2.0
func WithBindSecureParamIntMapFunc[T Integer](name string, fn func() (map[string]T, error)) ToolOption
WithBindSecureParamIntMapFunc binds a function that returns a map of integers to a secure parameter.
func WithBindSecureParamString ¶ added in v1.2.0
func WithBindSecureParamString(name string, value string) ToolOption
WithBindSecureParamString binds a static string value to a secure parameter.
func WithBindSecureParamStringArray ¶ added in v1.2.0
func WithBindSecureParamStringArray(name string, value []string) ToolOption
WithBindSecureParamStringArray binds a static slice of strings to a secure parameter.
func WithBindSecureParamStringArrayFunc ¶ added in v1.2.0
func WithBindSecureParamStringArrayFunc(name string, fn func() ([]string, error)) ToolOption
WithBindSecureParamStringArrayFunc binds a function that returns a slice of strings to a secure parameter.
func WithBindSecureParamStringFunc ¶ added in v1.2.0
func WithBindSecureParamStringFunc(name string, fn func() (string, error)) ToolOption
WithBindSecureParamStringFunc binds a function that returns a string to a secure parameter.
func WithBindSecureParamStringMap ¶ added in v1.2.0
func WithBindSecureParamStringMap(name string, value map[string]string) ToolOption
WithBindSecureParamStringMap binds a static map of strings to a secure parameter.
func WithBindSecureParamStringMapFunc ¶ added in v1.2.0
func WithBindSecureParamStringMapFunc(name string, fn func() (map[string]string, error)) ToolOption
WithBindSecureParamStringMapFunc binds a function that returns a map of strings to a secure parameter.
func WithStrict ¶
func WithStrict(strict bool) ToolOption
WithStrict provides an option to enable strict validation for LoadToolset.
type ToolSchema ¶
type ToolSchema = transport.ToolSchema
ToolSchema defines a single tool in the manifest.
type ToolboxClient ¶
type ToolboxClient struct {
// contains filtered or unexported fields
}
The synchronous interface for a Toolbox service client.
func NewToolboxClient ¶
func NewToolboxClient(url string, opts ...ClientOption) (*ToolboxClient, error)
NewToolboxClient creates and configures a new, immutable client for interacting with a Toolbox server.
Inputs:
- url: The base URL of the Toolbox server.
- opts: A variadic list of ClientOption functions to configure the client, such as setting a custom http.Client, default headers, or the underlying protocol.
Returns:
A configured *ToolboxClient and a nil error on success, or a nil client and an error if configuration fails.
func (*ToolboxClient) GetProtocol ¶ added in v1.1.0
func (tc *ToolboxClient) GetProtocol() Protocol
GetProtocol returns the active protocol version for the client.
func (*ToolboxClient) LoadTool ¶
func (tc *ToolboxClient) LoadTool(name string, ctx context.Context, opts ...ToolOption) (*ToolboxTool, error)
LoadTool fetches a manifest for a single tool
Inputs:
- name: The specific name of the tool to load.
- ctx: The context to control the lifecycle of the request.
- opts: A variadic list of ToolOption functions to configure auth tokens, bind parameters, or bind secure parameters for this tool.
Returns:
A configured *ToolboxTool and a nil error on success, or a nil tool and an error if loading or validation fails.
func (*ToolboxClient) LoadToolset ¶
func (tc *ToolboxClient) LoadToolset(name string, ctx context.Context, opts ...ToolOption) ([]*ToolboxTool, error)
LoadToolset fetches a manifest for a collection of tools.
Inputs:
- name: Name of the toolset to be loaded. Set this arg to "" to load the default toolset.
- ctx: The context to control the lifecycle of the request.
- opts: A variadic list of ToolOption functions. These can include WithStrict and options for auth, bound params, or secure params that may apply to tools in the set.
Returns:
A slice of configured *ToolboxTool and a nil error on success, or a nil slice and an error if loading or validation fails.
type ToolboxTool ¶
type ToolboxTool struct {
// contains filtered or unexported fields
}
ToolboxTool represents an immutable, universal definition of a Toolbox tool.
func (*ToolboxTool) DescribeParameters ¶
func (tt *ToolboxTool) DescribeParameters() string
DescribeParameters returns a single, human-readable string that describes all of the tool's unbound parameters, including their names, types, and descriptions. Secure parameters are strictly isolated and excluded.
Returns:
A formatted string of parameter descriptions, or an empty string if there are no unbound parameters.
func (*ToolboxTool) Description ¶
func (tt *ToolboxTool) Description() string
Description returns the tool's description.
func (*ToolboxTool) InputSchema ¶
func (tt *ToolboxTool) InputSchema() ([]byte, error)
InputSchema generates an OpenAPI JSON Schema for the tool's input parameters and returns it as raw bytes. Secure parameters are strictly isolated and never included in InputSchema.
func (*ToolboxTool) Invoke ¶
Invoke executes the tool with the given input.
Inputs:
- ctx: The context to control the lifecycle of the API request.
- input: A map of parameter names to values provided by the user for this specific invocation. Secure parameters cannot be passed in input and must be pre-configured on the tool.
Returns:
The result from the API call, which can be a structured object (from a JSON 'result' field) or a raw string. Returns an error if any step of the process fails, including if required secure parameters are missing.
func (*ToolboxTool) Parameters ¶
func (tt *ToolboxTool) Parameters() []ParameterSchema
Parameters returns the list of parameters that must be provided by a user at invocation time.
func (*ToolboxTool) SecureParameters ¶ added in v1.2.0
func (tt *ToolboxTool) SecureParameters() []ParameterSchema
SecureParameters returns the list of unbound secure parameters for the tool.
func (*ToolboxTool) ToolFrom ¶
func (tt *ToolboxTool) ToolFrom(opts ...ToolOption) (*ToolboxTool, error)
ToolFrom creates a new, more specialized tool from an existing one by applying additional options. This is useful for creating variations of a tool with different bound parameters or secure parameters without modifying the original, and all provided options must be applicable.
Inputs:
- opts: A variadic list of ToolOption functions to further configure the new tool, such as binding parameters, binding secure parameters, or providing auth tokens.
Returns:
A new, specialized *ToolboxTool and a nil error, or a nil tool and an error if the new options are invalid or conflict with existing settings.
