Documentation
¶
Overview ¶
Package adapter maps envelope values onto MCP CallToolResult values from go-sdk.
Use OK and ErrorCode for shorthand handlers; Options.Text controls text content mode.
Index ¶
- Variables
- func Error(err error) (*sdkmcp.CallToolResult, any, error)
- func ErrorCode(code string, err error) (*sdkmcp.CallToolResult, any, error)
- func ErrorCodeWithOptions(code string, err error, opts Options) (*sdkmcp.CallToolResult, any, error)
- func FromEnvelope(env *envelope.Envelope) (*sdkmcp.CallToolResult, any, error)
- func FromEnvelopeWithOptions(env *envelope.Envelope, opts Options) (*sdkmcp.CallToolResult, any, error)
- func OK(tool, summary string, data any, next ...string) (*sdkmcp.CallToolResult, any, error)
- func OKWithOptions(tool, summary string, data any, opts Options, next ...string) (*sdkmcp.CallToolResult, any, error)
- type Options
- type TextMode
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{Text: TextFull}
DefaultOptions is the default adapter configuration.
Functions ¶
func Error ¶
func Error(err error) (*sdkmcp.CallToolResult, any, error)
Error converts an error into an MCP error tool result.
func ErrorCodeWithOptions ¶
func ErrorCodeWithOptions(code string, err error, opts Options) (*sdkmcp.CallToolResult, any, error)
ErrorCodeWithOptions builds an error CallToolResult with adapter options.
func FromEnvelope ¶
FromEnvelope converts an envelope into an MCP CallToolResult.
func FromEnvelopeWithOptions ¶
func FromEnvelopeWithOptions(env *envelope.Envelope, opts Options) (*sdkmcp.CallToolResult, any, error)
FromEnvelopeWithOptions converts an envelope into an MCP CallToolResult.
func OK ¶
OK builds a success CallToolResult from tool name, summary, data, and optional next hints.
func OKWithOptions ¶
func OKWithOptions(tool, summary string, data any, opts Options, next ...string) (*sdkmcp.CallToolResult, any, error)
OKWithOptions builds a success CallToolResult with adapter options.
Types ¶
Click to show internal directories.
Click to hide internal directories.