apprtool

package
v1.153.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package apprtool is the manage_approval MCP tool (#2437, #2494): submitting a request, listing requests and deciding one are commands of one tool, over the service the portal's Approvals page uses.

Index

Constants

View Source
const (
	CmdSubmit = "submit"
	CmdList   = "list"
	CmdGet    = "get"
	CmdDecide = "decide"
)

The commands.

View Source
const ToolName = "manage_approval"

ToolName is the tool's name.

Variables

Commands is every command, in the order the schema lists them.

View Source
var Reads = []string{CmdList, CmdGet}

Reads is the commands that change nothing.

Functions

This section is empty.

Types

type Input

type Input struct {
	Command  string `json:"command"`
	Script   string `json:"script,omitempty"`
	Version  int    `json:"version,omitempty"`
	Purpose  string `json:"purpose,omitempty"`
	Reason   string `json:"reason,omitempty"`
	ID       string `json:"id,omitempty"`
	Decision string `json:"decision,omitempty"`
	Comment  string `json:"comment,omitempty"`
	Status   string `json:"status,omitempty"`
	Limit    int    `json:"limit,omitempty"`
}

Input is the tool's arguments.

type Tool

type Tool struct {
	Service *approval.Service
	// Persona resolves the persona a caller's roles resolve to, recorded on
	// a request; nil records none.
	Persona func(roles []string) string
}

Tool is the registered tool.

func (*Tool) Handle

func (t *Tool) Handle(ctx context.Context, in Input) (*mcp.CallToolResult, any, error)

Handle runs one command.

func (*Tool) Register

func (t *Tool) Register(server *mcp.Server)

Register adds manage_approval to the server.

Jump to

Keyboard shortcuts

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