serve

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInputSchema

func BuildInputSchema(action ActionSchema) map[string]any

BuildInputSchema converts an ActionSchema's field definitions into a JSON Schema object (as map[string]any) suitable for mcp.Tool.InputSchema. All fields are typed as "string" with a description from the map value.

func MakeToolHandler

func MakeToolHandler(f *cmdutil.Factory, actionType string) mcp.ToolHandler

MakeToolHandler returns a ToolHandler that POSTs to /api/execute/{actionType} with the tool call arguments as the JSON body.

func NewServeCmd

func NewServeCmd(f *cmdutil.Factory) *cobra.Command

func RegisterTools

func RegisterTools(server *mcp.Server, f *cmdutil.Factory) error

RegisterTools fetches the /api/mcp/schemas endpoint and registers one MCP tool per action. Tool names use underscore separators (e.g. "web3_transfer"). If the schemas fetch fails, a warning is logged to stderr and the server starts with zero tools -- this is intentional per design.

Types

type ActionSchema

type ActionSchema struct {
	ActionType          string            `json:"actionType"`
	Label               string            `json:"label"`
	Description         string            `json:"description"`
	Category            string            `json:"category"`
	Integration         string            `json:"integration"`
	RequiresCredentials bool              `json:"requiresCredentials"`
	RequiredFields      map[string]string `json:"requiredFields"`
	OptionalFields      map[string]string `json:"optionalFields"`
	OutputFields        map[string]string `json:"outputFields"`
}

ActionSchema describes a single action available from the MCP schemas endpoint.

type SchemasResponse

type SchemasResponse struct {
	Actions map[string]ActionSchema `json:"actions"`
}

SchemasResponse is the correct shape of the /api/mcp/schemas response. The Actions field is a map keyed by actionType (e.g. "web3/check-balance"). NOTE: This is intentionally separate from cmd/plugin/list.go which uses a different (incorrect) response shape for the protocol discovery commands.

Jump to

Keyboard shortcuts

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