wireerr

package
v0.70.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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. Return the errors this package builds or finds without wrapping them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindInternalError added in v0.70.0

func FindInternalError(err error) error

FindInternalError returns the bare -32603 error in err's chain, or nil when there is none. Return it unwrapped to preserve the original wire error.

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 InternalError added in v0.70.0

func InternalError(message string) error

InternalError builds a bare JSON-RPC internal error for a tool handler to return unwrapped.

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