apprtool

package
v1.169.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 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

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 CallHolder added in v1.161.0

type CallHolder interface {
	HeldRequest(ctx context.Context, held approval.HeldCall) (approval.CallRequest, error)
}

CallHolder asks a held call's policies again for the request submit files (callrun.Evaluator).

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"`
	// Kind is submit's subject (a script version, or a held call) and
	// list's filter; Tool, Arguments and Calls are a held call's (#2437).
	Kind      string         `json:"kind,omitempty"`
	Tool      string         `json:"tool,omitempty"`
	Arguments map[string]any `json:"arguments,omitempty"`
	Calls     int            `json:"calls,omitempty"`
	// Until is decide's deadline for an allowance, in RFC 3339.
	Until string `json:"until,omitempty"`
}

Input is the tool's arguments.

type Tool

type Tool struct {
	Service *approval.Service
	// Calls asks a held call's policies again; nil refuses kind=call.
	Calls CallHolder
	// 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