tool

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

Package tool compiles route-effective component contracts into MCP tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	// contains filtered or unexported fields
}

Argument is an immutable public projection of one canonical input field.

func (Argument) Aliases

func (a Argument) Aliases() []string

func (Argument) Description

func (a Argument) Description() string

func (Argument) DestinationType

func (a Argument) DestinationType() reflect.Type

func (Argument) Example

func (a Argument) Example() string

func (Argument) Path

func (a Argument) Path() string

func (Argument) PublicName

func (a Argument) PublicName() string

func (Argument) Required

func (a Argument) Required() bool

func (Argument) SourceKind

func (a Argument) SourceKind() string

func (Argument) SourceName

func (a Argument) SourceName() string

func (Argument) SourceType

func (a Argument) SourceType() reflect.Type

func (Argument) WireSchema

func (a Argument) WireSchema() *spec.WireSchema

func (Argument) WireSchemas

func (a Argument) WireSchemas() map[string]*spec.WireSchema

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler() *Compiler

func (*Compiler) Compile

func (c *Compiler) Compile(input Input) (*Plan, error)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(plan *Plan, invoker *invocation.Invoker) *Handler

func (*Handler) Handle

type Input

type Input struct {
	Fields         []registry.InputField
	Example        string
	TransportReady bool
	Documentation  *documentation.Snapshot
	Component      spec.Key
	Exposure       *spec.MCPExposure
	Contract       *registry.RouteInputContract
	// OutputType is the execution result shape. MCP output schemas are only
	// emitted for object-shaped structuredContent, as required by the protocol.
	OutputType reflect.Type
	// Output is the same compiled presentation plan used for MCP result encoding.
	Output *output.Plan
}

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan is one immutable exact-route MCP tool plan.

func (*Plan) Arguments

func (p *Plan) Arguments() []Argument

func (*Plan) Input

func (p *Plan) Input() *registry.RouteInputContract

func (*Plan) Metadata

func (p *Plan) Metadata() schema.Tool

func (*Plan) Scope

func (p *Plan) Scope(arguments map[string]interface{}) (*requestprovider.Scope, error)

func (*Plan) Target

func (p *Plan) Target() exec.ComponentTarget

Jump to

Keyboard shortcuts

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