mcp

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mcp provides an Adapter that parses MCP tools/list responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct{}

Adapter converts MCP tools/list payloads into []model.UnifiedTool.

func NewAdapter

func NewAdapter() *Adapter

NewAdapter returns a new MCP Adapter.

func (*Adapter) Parse

func (a *Adapter) Parse(_ context.Context, data []byte) ([]model.UnifiedTool, error)

Parse implements adapter.Adapter for the MCP tools/list response format.

func (*Adapter) Protocol

func (a *Adapter) Protocol() model.ProtocolType

Protocol implements adapter.Adapter.

type InputSchema

type InputSchema struct {
	Type        string                    `json:"type,omitempty"`
	Properties  map[string]SchemaProperty `json:"properties,omitempty"`
	Required    []string                  `json:"required,omitempty"`
	Description string                    `json:"description,omitempty"`
}

InputSchema is the JSON Schema fragment embedded in an MCP Tool.

type ListToolsResponse

type ListToolsResponse struct {
	Tools []Tool `json:"tools"`
}

ListToolsResponse is the top-level MCP tools/list wire format.

type SchemaProperty

type SchemaProperty struct {
	Type        string `json:"type,omitempty"`
	Description string `json:"description,omitempty"`
}

SchemaProperty describes a single property within an InputSchema.

type Tool

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

Tool is a single tool entry in the MCP tools/list response.

Jump to

Keyboard shortcuts

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