swagtools

package
v0.0.0-...-a17b574 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFunc

type ClientFunc func(ctx context.Context, req *mcp.CallToolRequest) *http.Client

ClientFunc returns the HTTP client to use for an operation. req is the original incoming MCP call — inspect req.Extra.Header for inbound auth tokens or other headers to forward to the upstream service.

type Dispatcher

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

Dispatcher reads the OpenAPI spec, generates MCP tools for the same. The tool handler function also validates the incoming schema spec, and calls the upstream endpoint.

func NewDispatcher

func NewDispatcher(baseURL string, clientFunc ClientFunc) *Dispatcher

NewDispatcher is used to create a new Dispatcher.

func (*Dispatcher) Handler

func (d *Dispatcher) Handler(ctx context.Context, req *mcp.CallToolRequest, input any) (
	*mcp.CallToolResult,
	any,
	error,
)

func (*Dispatcher) LoadSpec

func (d *Dispatcher) LoadSpec(specData string) error

func (*Dispatcher) Tools

func (d *Dispatcher) Tools() iter.Seq2[*mcp.Tool, error]

Jump to

Keyboard shortcuts

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