wireerr

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package wireerr builds and recognizes the JSON-RPC errors that vMCP's tool handlers return to the MCP SDK to put on the wire as-is. It is the only vMCP package that imports go-sdk's jsonrpc package, so the SDK rule below lives in one place.

The rule: go-sdk puts a handler's error on the wire with its code and data only when the error is a bare *jsonrpc.Error. For a wrapped one it keeps the code but drops the data. A handler must therefore return what URLElicitationRequired builds, or what FindURLElicitationRequired finds, without wrapping it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindURLElicitationRequired

func FindURLElicitationRequired(err error) error

FindURLElicitationRequired returns the bare -32042 error in err's chain, or nil when there is none. A handler that receives a wrapped -32042 from an inner handler returns the result unwrapped, so the data reaches the wire.

func URLElicitationRequired

func URLElicitationRequired(data json.RawMessage) error

URLElicitationRequired returns the MCP 2025-11-25 URLElicitationRequiredError (code -32042) carrying data, which the caller builds as {"elicitations": [...]}. Return it from a tool handler unwrapped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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