schema

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package schema provides utilities for generating MCP tool input schemas from Go structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromStruct

func FromStruct(v interface{}) protocol.ToolInputSchema

FromStruct generates a protocol.ToolInputSchema from struct tags. It examines the struct fields and their tags to create a schema that describes the expected input format for an MCP tool.

func HandleArgs

func HandleArgs[T any](arguments any) (*T, []protocol.Content, bool)

HandleArgs is a helper function that handles the common pattern of parsing and validating tool arguments into a strongly-typed struct. HandleArgs is a helper function that handles the common pattern of parsing and validating tool arguments (typically map[string]interface{}) into a strongly-typed struct T. It now uses mapstructure for more robust decoding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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