skill

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package skill provides interfaces for defining MCP tools and skills. This is a local stub that will be replaced with github.com/plexusone/omniskill/skill when that package becomes available.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameter

type Parameter struct {
	// Type is the JSON Schema type (string, number, boolean, array, object).
	Type string

	// Description explains the parameter's purpose.
	Description string

	// Required indicates whether the parameter must be provided.
	Required bool

	// Default is the default value if not provided.
	Default any

	// Enum lists allowed values for enum types.
	Enum []any
}

Parameter defines a tool parameter.

type Parameters

type Parameters map[string]Parameter

Parameters is a map of parameter names to their definitions.

type Skill

type Skill interface {
	// Name returns the skill identifier.
	Name() string

	// Description returns a human-readable description.
	Description() string

	// Init performs any initialization needed by the skill.
	Init(ctx context.Context) error

	// Close cleans up any resources.
	Close() error

	// Tools returns all tools provided by this skill.
	Tools() []Tool
}

Skill represents a collection of related tools that can be exposed via MCP.

type Tool

type Tool interface {
	// Name returns the tool identifier.
	Name() string

	// Description returns a human-readable description.
	Description() string

	// Parameters returns the parameter schema for this tool.
	Parameters() Parameters

	// Execute runs the tool with the given parameters.
	Execute(ctx context.Context, params map[string]any) (any, error)
}

Tool represents a single MCP tool.

func NewTool

func NewTool(
	name string,
	description string,
	parameters Parameters,
	handler func(ctx context.Context, params map[string]any) (any, error),
) Tool

NewTool creates a new tool with the given name, description, parameters, and handler.

Jump to

Keyboard shortcuts

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