mcpops

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package mcpops mounts catalog operations on an MCP server. The tool's name, title, description, input schema and read-only hint all come from the Spec; the binder supplies only the handler and its output type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount[In, Out any](srv *mcp.Server, s ops.Spec[In], h func(context.Context, In) (Out, error), mapErr func(error) error)

Mount registers s on srv with handler h. A handler error that is an *ops.Error crosses as "<kind>: <message>"; any other error goes through mapErr, the binder's own error mapping. It panics on a schema error, as mcp.AddTool does.

func MountResult

func MountResult[In, Out any](srv *mcp.Server, s ops.Spec[In], h func(context.Context, In) (*mcp.CallToolResult, Out, error), mapErr func(error) error)

MountResult is Mount for a handler that may answer with its own content, such as an image, instead of a structured value.

It registers a raw handler rather than going through mcp.AddTool, because the SDK reports a schema violation as text with no kind in front of it, and a caller reads the kind to decide what went wrong. Arguments are validated against the same schema the tool advertises, and a violation is invalid.

func Tool

func Tool[In any](s ops.Spec[In]) (*mcp.Tool, error)

Tool is the MCP tool entry for s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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