schema

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 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 (
	NamespaceBuiltin = "builtin"
	NamespaceMCP     = "mcp"
	NamespaceAgent   = "agent"
)

The types of namespaces: those which are built in, those of MCP servers, and the agents'

View Source
const (
	// ToolSeparator separates the namespace and name in a tool's canonical
	// name
	ToolSeparator = ":"

	// The events of a stream of a tool which is called: a log event for
	// each line it logs, a progress event for how it's getting on, and then
	// a result event, with its result, or an error event
	EventLog      = "log"
	EventProgress = "progress"
	EventResult   = "result"
	EventError    = "error"

	// ModelToolSeparator separates the namespace and name in the name a
	// model calls a tool by, which a namespace, or a tool's name, can't
	// have, so it's separated where it is
	ModelToolSeparator = "__"
)

Variables

This section is empty.

Functions

func CanonicalFromModelToolName added in v0.6.0

func CanonicalFromModelToolName(name string) string

CanonicalFromModelToolName returns the canonical name of the tool which a model calls by the name, such as homeassistant:call_service for homeassistant__call_service, or the name, when it isn't a tool in a namespace, such as respond

func CanonicalToolName

func CanonicalToolName(namespace, name string) string

CanonicalToolName returns the canonical name of a tool in a namespace, which is the namespace and tool name separated by a colon

func IsModelToolPart added in v0.6.0

func IsModelToolPart(name string) bool

IsModelToolPart returns true when the name, of a namespace, or of a tool in one, can be part of the name a model calls a tool by, so it's separated where it is: it doesn't have two underscores, and doesn't start, or end, with one, which would be next to the separator

func ModelToolName added in v0.6.0

func ModelToolName(namespace, name string) string

ModelToolName returns the name a model calls a tool in a namespace by, which is the namespace and tool name separated by two underscores, as a model's tool names can't have a colon, such as homeassistant__call_service

Types

type CallToolRequest

type CallToolRequest struct {
	Input json.RawMessage `` /* 127-byte string literal not displayed */
}

CallToolRequest is a request to run a tool with its input

func (CallToolRequest) String

func (t CallToolRequest) String() string

type ErrorEvent added in v0.6.0

type ErrorEvent struct {
	Error string `json:"error" help:"Error of the tool, as it would be without a stream"`
}

ErrorEvent is the data of an error event, which ends a stream when the tool fails

type LogEvent added in v0.6.0

type LogEvent struct {
	Text string `json:"text" help:"Line which the tool logged"`
}

LogEvent is the data of a log event, of a line which a tool logs, as it runs, when it's called with a stream

type Namespace added in v1.0.0

type Namespace struct {
	Name        string `json:"name" readonly:"" help:"Name of the namespace" example:"weatherapi"`
	Type        string `` /* 150-byte string literal not displayed */
	Description string `` /* 147-byte string literal not displayed */
	Tools       uint64 `json:"tools" readonly:"" help:"How many tools the namespace has" example:"3"`
}

Namespace is a namespace of tools: its name, a line which describes it, which can be empty, and how many tools it has

func (Namespace) Cell added in v1.0.0

func (n Namespace) Cell(col int) tui.CellText

Cell returns the namespace's name, its type, how many tools it has, and its description

func (Namespace) Header added in v1.0.0

func (Namespace) Header() []string

func (Namespace) Width added in v1.0.0

func (Namespace) Width(int) int

type NamespaceList added in v1.0.0

type NamespaceList struct {
	Count uint64       `json:"count"`
	Body  []*Namespace `json:"body,omitempty"`
}

NamespaceList is the namespaces, with their number

func (NamespaceList) String added in v1.0.0

func (n NamespaceList) String() string

type ProgressEvent added in v0.6.0

type ProgressEvent struct {
	Status   string  `json:"status" help:"What the tool is doing, which is its message"`
	Percent  float64 `json:"percent" help:"Percentage which is complete, from 0 to 100, or zero when it isn't known"`
	Progress float64 `json:"progress,omitempty" help:"How far the tool has got, which increases each time"`
	Total    float64 `json:"total,omitempty" help:"How far the tool has to go, when it's known"`
	Message  string  `json:"message,omitempty" help:"What the tool is doing"`
}

ProgressEvent is the data of a progress event, of how a tool is getting on, as it runs, when it's called with a stream, as MCP's progress notification is, with its status and percent, as a model's download is

type ResourceLink struct {
	URI   string `` /* 170-byte string literal not displayed */
	Name  string `json:"name,omitempty" help:"Name of the resource, such as its file's name" example:"speech.wav"`
	Title string `json:"title,omitempty" help:"Title of the resource, for people, which is its description" example:"Ode to David"`
	Type  string `json:"type,omitempty" help:"MIME type of the resource" example:"audio/wav"`
	Size  int64  `json:"size,omitempty" help:"Size of the resource's content, in bytes" example:"103724"`
}

ResourceLink is a resource which a tool returned, as its result has it, which is kept, and referred to by its URI, such as resource:///<hash>, rather than its content, as MCP's resource links are

type ResourcesResult added in v1.3.0

type ResourcesResult struct {
	Result    any            `json:"result,omitempty" help:"What the tool returned with the resources, when it did"`
	Resources []ResourceLink `json:"resources" help:"The resources the tool returned, as links to them"`
}

ResourcesResult is the result of a tool which returned resources: the value it returned with them, when it did, and the links to them

type ResultEvent added in v0.6.0

type ResultEvent struct {
	Result json.RawMessage `json:"result,omitempty" help:"Result of the tool, as JSON, which is left out when it has none"`
}

ResultEvent is the data of a result event, which ends a stream when the tool returns: its result, which is left out when it has none, so a result which is JSON null is told apart from none

type Tool

type Tool struct {
	Name        string          `json:"name" readonly:"" help:"Tool name" example:"current"`
	Canonical   string          `` /* 150-byte string literal not displayed */
	Type        string          `` /* 157-byte string literal not displayed */
	Title       string          `` /* 163-byte string literal not displayed */
	Agent       bool            `` /* 162-byte string literal not displayed */
	Description string          `` /* 127-byte string literal not displayed */
	Input       json.RawMessage `json:"input,omitempty" readonly:"" help:"JSON schema of the tool's input"`
	Output      json.RawMessage `json:"output,omitempty" readonly:"" help:"JSON schema of the tool's output, if it has one"`
}

Tool is a tool which models can call

func (Tool) Cell

func (t Tool) Cell(col int) tui.CellText

func (Tool) Header

func (t Tool) Header() []string

func (Tool) String

func (t Tool) String() string

func (Tool) Width

func (t Tool) Width(col int) int

type ToolList

type ToolList struct {
	ToolListRequest
	Count uint64  `json:"count"`
	Body  []*Tool `json:"body,omitempty"`
}

ToolList is the tools, with their number

func (ToolList) String

func (t ToolList) String() string

type ToolListRequest

type ToolListRequest struct {
	Namespace string `json:"namespace,omitempty" help:"Returns only the tools in this namespace" example:"weatherapi" optional:""`
	Type      string `` /* 136-byte string literal not displayed */
}

ToolListRequest filters a list of tools

func (ToolListRequest) Query

func (t ToolListRequest) Query() url.Values

Query returns the request as URL query parameters

func (ToolListRequest) String

func (t ToolListRequest) String() string

Jump to

Keyboard shortcuts

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