infrastructure

package
v0.251.0 Latest Latest
Warning

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

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

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