tools

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 1 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

Overview

Package tools provides schema helpers for building tool parameter JSON schemas. JSON Schema parameter definitions in a type-safe way.

Example:

func (t *SearchTool) Parameters() interfaces.JSONSchema {
    return tools.Params(
        map[string]interfaces.JSONSchema{
            "query": tools.ParamString("Search query"),
            "limit": tools.ParamInteger("Max results (default 10)"),
        },
        "query",
    )
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParamArray

func ParamArray(description string, items interfaces.JSONSchema) interfaces.JSONSchema

ParamArray returns a JSON Schema for an array parameter.

func ParamBool

func ParamBool(description string) interfaces.JSONSchema

ParamBool returns a JSON Schema for a boolean parameter.

func ParamEnum

func ParamEnum(description string, values ...any) interfaces.JSONSchema

ParamEnum returns a JSON Schema for an enum parameter.

func ParamInteger

func ParamInteger(description string) interfaces.JSONSchema

ParamInteger returns a JSON Schema for an integer parameter.

func ParamNumber

func ParamNumber(description string) interfaces.JSONSchema

ParamNumber returns a JSON Schema for a number parameter.

func ParamString

func ParamString(description string) interfaces.JSONSchema

ParamString returns a JSON Schema for a string parameter.

func Params

func Params(properties map[string]interfaces.JSONSchema, required ...string) interfaces.JSONSchema

Params builds the full parameters schema for a tool. Properties is a map of parameter name to its schema. Required lists parameter names that must be provided.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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