Documentation
¶
Overview ¶
Package mcptool holds what generated MCP tools call: their input, result and error.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error is err as an MCP tool reports it. The assistant reads only the message, so the message of a *httpclient.APIError is followed by the response body, at most 4 KiB of it.
func Input ¶
func Input(args json.RawMessage, in any) error
Input decodes the arguments of an MCP tool call into in again. The SDK reads them through float64, which rounds an integer above 2^53; an integer written as plain digits keeps all of them here. A key the call left out keeps what in holds, so the defaults the SDK filled in stay.
Types ¶
type Result ¶
type Result struct {
Value any
}
Result is the structured content of an MCP tool. Clients before protocol 2026-07-28 take only a JSON object there, so Value is written as it is when it is one, else as {"result": Value}.
func (Result) MarshalJSON ¶
MarshalJSON writes Value as a JSON object.