types

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package types defines the core data structures used throughout the echo-mcp library. This includes MCP protocol types, tool definitions, schema representations, and utility functions for JSON schema generation from Go types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchema

func GetSchema(input any) map[string]any

GetSchema generates a JSON schema from a Go type using reflection and struct tags

Types

type MCPError

type MCPError struct {
	Data    any    `json:"data,omitempty"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type MCPMessage

type MCPMessage struct {
	Params  any             `json:"params,omitempty"`
	Result  any             `json:"result,omitempty"`
	Error   *MCPError       `json:"error,omitempty"`
	Jsonrpc string          `json:"jsonrpc"`
	Method  string          `json:"method,omitempty"`
	ID      json.RawMessage `json:"id,omitempty"`
}

type Operation

type Operation struct {
	Parameters     map[string]any
	Method         string
	Path           string
	Description    string
	HeaderParams   []string
	QueryParams    []string
	FormDataParams []string
}

type RegisteredSchemaInfo

type RegisteredSchemaInfo struct {
	QuerySchema any
	BodySchema  any
}

type Tool

type Tool struct {
	InputSchema any    `json:"inputSchema"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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