infrastructure

package
v0.265.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 13 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

Index

Constants

View Source
const (
	ProtocolVersion = "2026-07-28"
)

infer speaks one MCP revision. 2026-07-28 is stateless: every request stands alone and carries its version in params._meta, mirrored into headers. Servers on other revisions are not supported, and there is no fallback.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client speaks MCP 2026-07-28 to one server.

func NewClient

func NewClient(url string, headers map[string]string) *Client

NewClient returns a client for the server at url that sends headers, such as an API key, on every request. Callers bound each call with the context's deadline.

func (*Client) CallTool

func (c *Client) CallTool(ctx context.Context, name string, args map[string]any) (mcpdomain.CallResult, error)

CallTool runs a tool and flattens its content blocks to text. arguments is always sent, as {} when there are none, since some servers fail to decode a call without it.

func (*Client) Discover

func (c *Client) Discover(ctx context.Context) error

Discover asks the server which protocol versions it speaks. Anything but a transport failure, auth refusal or a list naming ProtocolVersion means the server is on another revision.

func (*Client) ListTools

func (c *Client) ListTools(ctx context.Context) ([]mcpdomain.Tool, error)

ListTools fetches every page of the server's tools.

Jump to

Keyboard shortcuts

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