api

package
v1.1.20 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package api exposes the service twice from one process: REST/JSON under /api/v1 for the portal backend, and MCP tools for muster. Both map onto the same service methods so behavior cannot drift between them.

Index

Constants

View Source
const (
	ToolGetInfo          = "get_info"
	ToolListAgents       = "list_agents"
	ToolGetAgent         = "get_agent"
	ToolCreateAgent      = "create_agent"
	ToolUpdateAgent      = "update_agent"
	ToolDeleteAgent      = "delete_agent"
	ToolGetAgentStatus   = "get_agent_status"
	ToolValidateAgent    = "validate_agent"
	ToolListModelConfigs = "list_model_configs"
	ToolListSkills       = "list_skills"
)

MCP tool names. Through muster they appear as x_<server>_<tool>, e.g. x_agent-manager_create_agent.

View Source
const Prefix = "/api/v1"

Prefix is the REST base path.

Variables

This section is empty.

Functions

func NewMCPServer

func NewMCPServer(svc *agents.Service, version string) *mcpserver.MCPServer

NewMCPServer builds an MCP server exposing the same operations as the REST API as tools. Results are JSON text with the same shapes as the REST bodies.

func SpecToUpdate

func SpecToUpdate(s agents.Spec) agents.Update

SpecToUpdate turns a full spec into a partial update: every non-empty field becomes a change, empty ones stay untouched. Used by validate (update mode) and by the MCP update tool, whose arguments are flat.

func ToolNames

func ToolNames() []string

ToolNames lists every tool the MCP server registers.

Types

type REST

type REST struct {
	// contains filtered or unexported fields
}

REST serves the JSON API.

func NewREST

func NewREST(svc *agents.Service, log *slog.Logger) *REST

NewREST builds the REST handler set.

func (*REST) Register

func (h *REST) Register(mux *http.ServeMux)

Register mounts the routes on mux.

Jump to

Keyboard shortcuts

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