tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MPL-2.0 Imports: 10 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

Overview

Package tools holds helpers shared by the MCP tool sets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.2.0

func Add[In any](server *mcp.Server, t Tool[In])

Add registers the tool on the server.

func GetResources

func GetResources(ctx context.Context, st state.State, in ResourceQuery) (string, error)

GetResources gets or lists COSI resources matching the query and renders them as YAML.

func InputSchema added in v0.2.0

func InputSchema[In any](patch func(props map[string]*jsonschema.Schema)) *jsonschema.Schema

InputSchema infers the input schema of In and lets patch adjust its properties.

func Text

func Text(s string) *mcp.CallToolResult

Text wraps a string into a tool result.

Types

type ResourceQuery

type ResourceQuery struct {
	Type      string `json:"type"`
	ID        string `json:"id,omitempty" jsonschema:"resource ID; omit to list all resources of the type"`
	Namespace string `json:"namespace,omitempty" jsonschema:"resource namespace; defaults to the type's default namespace"`
	Selector  string `json:"selector,omitempty"`
}

ResourceQuery selects COSI resources, as `omnictl get`/`talosctl get` do.

Tools describe type and selector with their own examples, see InputSchema.

type Tool added in v0.2.0

type Tool[In any] struct {
	Def     *mcp.Tool
	Handler mcp.ToolHandlerFor[In, any]
}

Tool pairs a tool definition with its typed handler.

Directories

Path Synopsis
Package imagefactory implements Image Factory tools.
Package imagefactory implements Image Factory tools.
Package omni implements Omni tools.
Package omni implements Omni tools.
Package talos implements Talos tools, reaching nodes either directly or through Omni.
Package talos implements Talos tools, reaching nodes either directly or through Omni.

Jump to

Keyboard shortcuts

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