toolinput

package
v0.0.14-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypeMissingRequiredProperty = errors.New("missing required property")

	ErrMissingRequestedProperty = errors.New("missing requested property")
	ErrCouldNotParseProperty    = errors.New("could not parse property")

	ErrUnknownProperty     = errors.New("unknown property")
	ErrUnknownPropertyType = errors.New("unknown property type")
)

Functions

This section is empty.

Types

type ToolInput

type ToolInput interface {
	Boolean(name string) (bool, error)
	BooleanOr(name string, defaultValue bool) bool
	String(name string) (string, error)
	StringOr(name string, defaultValue string) string
	Number(name string) (float64, error)
	NumberOr(name string, defaultValue float64) float64
	Object(name string) (map[string]interface{}, error)
	ObjectOr(name string, defaultValue map[string]interface{}) map[string]interface{}
	Array(name string) ([]interface{}, error)
	ArrayOr(name string, defaultValue []interface{}) []interface{}
}

type ToolInputSchema

type ToolInputSchema interface {
	GetMcpToolInputSchema() mcp.ToolInputSchema
	Validate(args map[string]interface{}) (ToolInput, error)
}

func NewToolInputSchema

func NewToolInputSchema(opts ...ToolInputSchemaOption) ToolInputSchema

type ToolInputSchemaOption

type ToolInputSchemaOption func(*toolInputSchema)

func WithArray

func WithArray(name string, description string, items map[string]interface{}) ToolInputSchemaOption

func WithBoolean

func WithBoolean(name string, description string) ToolInputSchemaOption

func WithNumber

func WithNumber(name string, description string) ToolInputSchemaOption

func WithObject

func WithObject(name string, description string, properties map[string]map[string]interface{}) ToolInputSchemaOption

func WithRequiredBoolean

func WithRequiredBoolean(name string, description string) ToolInputSchemaOption

func WithRequiredNumber

func WithRequiredNumber(name string, description string) ToolInputSchemaOption

func WithRequiredObject

func WithRequiredObject(name string, description string, properties map[string]map[string]interface{}) ToolInputSchemaOption

func WithRequiredString

func WithRequiredString(name string, description string) ToolInputSchemaOption

func WithString

func WithString(name string, description string) ToolInputSchemaOption

Jump to

Keyboard shortcuts

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