mcptest

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mcptest calls owner diagnostic tools directly, without a protocol adapter. It keeps transport testing separate from capture and query behavior.

Example: result := mcptest.Call[map[string]any](t, tool, `{}`)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call[T any](t *testing.T, tool mcp.Tool, arguments string) T

Call invokes a tool with strict JSON arguments and decodes its object result. Tool and decode failures fail the test with the managed name as context. Example: result := mcptest.Call[map[string]any](t, mcptest.Find(t, tools, "app.info"), `{}`)

func Find

func Find(t *testing.T, tools []mcp.Tool, name string) mcp.Tool

Find locates one tool by its full managed name and checks its declaration. Missing or invalid declarations fail the test before any handler is invoked. Example: tool := mcptest.Find(t, tools, "app.info")

Types

This section is empty.

Jump to

Keyboard shortcuts

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