wire

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 6 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 wire loads a capture of JSON-RPC messages as seen on the MCP boundary. Spans never carry the raw params._meta values, so checks on the wire format of trace context (SEP-414) need this second input.

Capture format: newline-delimited JSON, one object per received message:

{"method":"tools/call","_meta":{"traceparent":"00-...-01"}}

Any extra fields are ignored. The harness in examples/ writes this with the -capture flag; other producers (proxies, SDK hooks) can emit the same.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Method string         `json:"method"`
	Meta   map[string]any `json:"_meta"`
	Line   int            `json:"-"`
}

Message is one captured JSON-RPC request or notification.

func Load

func Load(r io.Reader) ([]Message, error)

Load reads newline-delimited capture records. Blank lines are skipped.

func LoadFile

func LoadFile(path string) ([]Message, error)

LoadFile reads a capture file.

Jump to

Keyboard shortcuts

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