invocation

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: 19 Imported by: 0

Documentation

Overview

Package invocation adapts MCP calls to the protocol-neutral component port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Invoker   exec.ComponentInvoker
	Client    xmcp.Client
	Authorize func(context.Context, exec.ComponentTarget) error
	// Output selects the component's compiled JSON presentation adapter.
	Output func(exec.ComponentTarget) OutputEncoder
}

type Execution

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

Execution is the protocol-neutral outcome of one exact MCP component call.

func (*Execution) Error

func (e *Execution) Error() error

func (*Execution) Payload

func (e *Execution) Payload() ([]byte, error)

func (*Execution) StatusCode

func (e *Execution) StatusCode() int

func (*Execution) ToolResult

func (e *Execution) ToolResult() *schema.CallToolResult

func (*Execution) Value

func (e *Execution) Value() interface{}

type Invoker

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

func New

func New(config Config) *Invoker

func (*Invoker) Execute

func (i *Invoker) Execute(ctx context.Context, request Request) (*Execution, *jsonrpc.Error)

type OutputEncoder added in v1.1.0

type OutputEncoder func(context.Context, any) ([]byte, error)

OutputEncoder applies a compiled presentation contract without exposing its runtime owner to the protocol-neutral invocation package.

type Request

type Request struct {
	Target exec.ComponentTarget
	Scope  *requestprovider.Scope
	Method string
	URI    string
}

Jump to

Keyboard shortcuts

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