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.
Types ¶
This section is empty.