mcp

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 24 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 mcp exposes rotari state through the Model Context Protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(masterDir string, options Options) *mcpsdk.Server

NewServer creates an MCP server for the runs and basedirs registered under masterDir. options supplies what its tools that change state need.

Types

type ApplyImportInput

type ApplyImportInput struct {
	ImportInput
	IfRevision string `json:"if_revision" jsonschema:"revision from rotari_preview_import; the import applies only if the project is still at it"`
}

type ApplyResetInput

type ApplyResetInput struct {
	ResetInput
	IfRevision         string `json:"if_revision" jsonschema:"revision from rotari_preview_reset; the reset applies only if the project is still at it"`
	RecoverInterrupted *bool  `` /* 148-byte string literal not displayed */
}

type ApplyUnlockInput

type ApplyUnlockInput struct {
	UnlockInput
	IfRevision string `` /* 222-byte string literal not displayed */
}

type CheckProjectInput

type CheckProjectInput struct {
	BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
	Project    string `json:"project" jsonschema:"project name"`
}

type CheckProjectOutput

type CheckProjectOutput struct {
	BaseDirRef string `json:"basedir_ref"`
	Project    string `json:"project"`
	State      string `json:"state" jsonschema:"ready, empty, running, locked (running on another host or in another PID namespace), or interrupted"`
	Runnable   bool   `json:"runnable"`
	Queued     *int   `json:"queued" jsonschema:"queued jobs; null when the queue of an active or interrupted project cannot be read"`
	Lock       string `json:"lock"`
	RunID      string `json:"run_id,omitempty"`
	Revision   string `json:"revision"`
}

type CompareRunsInput

type CompareRunsInput struct {
	RunID         string `json:"run_id" jsonschema:"exact ID of the newer run"`
	PreviousRunID string `` /* 144-byte string literal not displayed */
	AllJobs       bool   `` /* 251-byte string literal not displayed */
}

type CompareRunsOutput

type CompareRunsOutput struct {
	BaseDirRef string            `json:"basedir_ref"`
	Project    string            `json:"project"`
	Comparison runlineage.Result `json:"comparison"`
	// HiddenUnchanged counts the unchanged jobs left out of Comparison.Jobs.
	HiddenUnchanged int `json:"hidden_unchanged,omitempty"`
	// HiddenChanged counts the jobs left out beyond the limit, whose only
	// change is their definition.
	HiddenChanged int `json:"hidden_changed,omitempty"`
}

type ControlJobsInput

type ControlJobsInput struct {
	RunID  string   `json:"run_id" jsonschema:"exact ID of the running run; the operation fails if it is no longer running"`
	JobIDs []string `` /* 156-byte string literal not displayed */
}

type ControlJobsOutput

type ControlJobsOutput struct {
	Project string `json:"project"`
	RunID   string `json:"run_id"`
	Message string `json:"message"`
}

type ExportRunInput

type ExportRunInput struct {
	RunID  string `json:"run_id" jsonschema:"exact run ID"`
	Format string `json:"format,omitempty" jsonschema:"manifest format: yaml (default), json, or toml"`
}

type ExportRunOutput

type ExportRunOutput struct {
	BaseDirRef string `json:"basedir_ref"`
	Project    string `json:"project"`
	Format     string `json:"format"`
	// Manifest is the run as a workflow manifest, with environment values,
	// executor options, and paths redacted.
	Manifest string `json:"manifest"`
}

type GetJobInfoInput

type GetJobInfoInput struct {
	RunID string `json:"run_id" jsonschema:"exact run ID containing the job"`
	JobID string `json:"job_id" jsonschema:"exact job ID to inspect"`
}

type GetJobInfoOutput

type GetJobInfoOutput struct {
	Project string `json:"project"`
	RunID   string `json:"run_id"`
	JobID   string `json:"job_id"`
	Report  string `json:"report"`
}

type ImportInput

type ImportInput struct {
	BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the destination state directory, from rotari_list_projects"`
	Project    string `json:"project" jsonschema:"destination project; created if it does not exist"`
	Manifest   string `json:"manifest" jsonschema:"workflow manifest text, as rotari export writes it"`
	Format     string `json:"format,omitempty" jsonschema:"manifest format: yaml (default), json, or toml"`
	Overwrite  bool   `json:"overwrite,omitempty" jsonschema:"replace a queue that already has jobs"`
	Detail     bool   `json:"detail,omitempty" jsonschema:"also return the full plan, with each job's command and each task's source attempt"`
}

type ImportOutput

type ImportOutput struct {
	workflowstate.PlanSummary
	Plan *workflowstate.Plan `json:"plan,omitempty"`
}

ImportOutput is an import plan's summary and, when asked for, the plan.

type JobControlInput

type JobControlInput struct {
	RunID     string   `json:"run_id" jsonschema:"exact ID of the running run"`
	Operation string   `json:"operation" jsonschema:"cancel, suspend, or resume"`
	JobNames  []string `` /* 174-byte string literal not displayed */
}

type JobControlPreview

type JobControlPreview struct {
	Project   string   `json:"project"`
	RunID     string   `json:"run_id"`
	Operation string   `json:"operation"`
	JobIDs    []string `` /* 143-byte string literal not displayed */
}

type ListProjectsInput

type ListProjectsInput struct{}

type ListProjectsOutput

type ListProjectsOutput struct {
	Projects []ProjectOverview `json:"projects"`
	// Unreadable lists registered basedirs whose projects could not be read.
	Unreadable []UnreadableBaseDir `json:"unreadable,omitempty"`
}

type Options

type Options struct {
	// NewJobID returns a fresh job ID for an imported queue.
	NewJobID func() string
	// StartRun starts a supervisor for paths' project and sends it request,
	// returning its response. Without it, runs cannot be started.
	StartRun func(paths state.ProjectPaths, request server.Request) (server.Response, error)
	// Actor labels the runs this server starts (ROTARI_ACTOR); empty leaves
	// them unlabelled.
	Actor string
}

Options supplies what the tools that change state need from the rotari process that serves them.

type PlannedJob

type PlannedJob struct {
	ID   string `json:"id"`
	Name string `json:"name,omitempty"`
	// DependsOnRerun names the dependency that executes, for a job the
	// selection left out but that executes because of it.
	DependsOnRerun string `` /* 129-byte string literal not displayed */
}

type ProjectOverview

type ProjectOverview struct {
	BaseDirRef  string `json:"basedir_ref" jsonschema:"path-free reference to the project's state directory"`
	BaseDirName string `json:"basedir_name" jsonschema:"last element of the state directory's path"`
	Project     string `json:"project"`
	State       string `json:"state" jsonschema:"idle, running, or interrupted"`
	Queued      int    `json:"queued"`
	Runs        int    `json:"runs"`
	LastRunID   string `json:"last_run_id,omitempty"`
	LastStatus  string `json:"last_run_status,omitempty"`
	LastJobs    int    `json:"last_run_jobs,omitempty"`
	LastFailed  int    `json:"last_run_failed,omitempty"`
}

type ResetInput

type ResetInput struct {
	BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
	Project    string `json:"project" jsonschema:"project name"`
}

type ResetOutput

type ResetOutput struct {
	Project  string `json:"project"`
	Cleared  int    `json:"cleared" jsonschema:"queued jobs the reset removes"`
	Revision string `json:"revision" jsonschema:"for a preview, the revision to pass to rotari_reset; after a reset, the new revision"`
}

type RunInput

type RunInput struct {
	BaseDirRef string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
	Project    string `json:"project" jsonschema:"project name"`
	RunID      string `` /* 128-byte string literal not displayed */
	Retry      bool   `` /* 218-byte string literal not displayed */
}

type RunPreviewOutput

type RunPreviewOutput struct {
	Project           string       `json:"project"`
	Execute           []PlannedJob `json:"execute" jsonschema:"jobs the run would execute"`
	Jobs              int          `json:"jobs" jsonschema:"jobs in the run snapshot"`
	Carried           int          `json:"carried" jsonschema:"results the run would carry forward instead of executing"`
	SourceRun         string       `json:"source_run,omitempty" jsonschema:"saved run whose results the selection references"`
	OmittedSourceJobs []string     `` /* 130-byte string literal not displayed */
	Revision          string       `json:"revision" jsonschema:"revision to pass to rotari_start_run"`
}

type RunSummaryInput

type RunSummaryInput struct {
	RunID   string `json:"run_id" jsonschema:"exact run ID"`
	AllJobs bool   `` /* 139-byte string literal not displayed */
}

type RunSummaryOutput

type RunSummaryOutput struct {
	BaseDirRef string                `json:"basedir_ref"`
	Project    string                `json:"project"`
	State      project.RunPhase      `` /* 166-byte string literal not displayed */
	Summary    runlineage.RunSummary `json:"summary"`
}

type StartRunInput

type StartRunInput struct {
	RunInput
	IfRevision string `json:"if_revision" jsonschema:"revision from rotari_preview_run; the run starts only if the project is still at it"`
	RunName    string `json:"run_name,omitempty" jsonschema:"label for the run"`
	Note       string `json:"note,omitempty" jsonschema:"why the run is made, recorded with it and shown by rotari show and lineage"`
}

type StartRunOutput

type StartRunOutput struct {
	Project           string   `json:"project"`
	RunID             string   `json:"run_id"`
	SourceRun         string   `json:"source_run,omitempty"`
	OmittedSourceJobs []string `json:"omitted_source_jobs,omitempty"`
}

type UnlockInput

type UnlockInput struct {
	BaseDirRef    string `json:"basedir_ref" jsonschema:"basedir_ref of the project, from rotari_list_projects"`
	Project       string `json:"project" jsonschema:"project name"`
	RunID         string `json:"run_id,omitempty" jsonschema:"the interrupted run to recover; by default the one the project's lock or metadata names"`
	AssumeStopped bool   `` /* 221-byte string literal not displayed */
}

type UnlockOutput

type UnlockOutput struct {
	ExecutionChecked bool                          `` /* 235-byte string literal not displayed */
	Project          string                        `json:"project"`
	InterruptedRunID string                        `` /* 141-byte string literal not displayed */
	InterruptedRun   string                        `json:"interrupted_run,omitempty" jsonschema:"what the interrupted run's jobs last reported"`
	JobsMayBeRunning bool                          `` /* 169-byte string literal not displayed */
	Revision         string                        `json:"revision" jsonschema:"for a preview, the revision to pass to rotari_unlock; after an unlock, the new revision"`
	Coordinator      project.CoordinatorAssessment `json:"coordinator"`
	Allowed          bool                          `json:"allowed"`
	Applied          bool                          `json:"applied"`
	RefusalCode      string                        `json:"refusal_code,omitempty"`
	AssumeStopped    bool                          `json:"assume_stopped"`
	Action           string                        `` /* 126-byte string literal not displayed */
	Repair           project.RepairAssessment      `json:"repair"`
}

type UnreadableBaseDir

type UnreadableBaseDir struct {
	BaseDirRef  string `json:"basedir_ref"`
	BaseDirName string `json:"basedir_name"`
	Error       string `json:"error"`
}

type WaitRunInput

type WaitRunInput struct {
	RunID          string `json:"run_id" jsonschema:"exact run ID, such as rotari_start_run returns"`
	TimeoutSeconds int    `json:"timeout_seconds,omitempty" jsonschema:"how long to wait, 1 to 300 seconds; default 30. Call again to keep waiting."`
	UntilFailure   bool   `` /* 139-byte string literal not displayed */
	AllJobs        bool   `json:"all_jobs,omitempty" jsonschema:"list every job of each failure group, as rotari_run_summary does with all_jobs"`
}

type WaitRunOutput

type WaitRunOutput struct {
	RunSummaryOutput
	Reason string `` /* 182-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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