edit_assessment

package
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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 edit_assessment implements the edit_assessment MCP tool: a single entry point for editing a conducted assessment (answers, status, name, owner, assignees, visibility) via a typed list of operations. Assessments are NOT catalog assets — they live in the Assessments application's own REST API, which takes ONE partial PATCH. So unlike edit_asset (many API calls), this tool validates every operation up front, collects them into a single UpdateAssessmentRequest, and makes ONE UpdateAssessment call: the PATCH is atomic, so any validation failure aborts the whole request.

Index

Constants

View Source
const (
	StatusDraft     = "DRAFT"
	StatusSubmitted = "SUBMITTED"
	StatusObsolete  = "OBSOLETE"
)

Valid assessment statuses.

Variables

This section is empty.

Functions

func NewTool

func NewTool(collibraClient *http.Client) *chip.Tool[Input, Output]

NewTool returns the registered tool.

Types

type AssigneeInput

type AssigneeInput struct {
	ID   string `json:"id" jsonschema:"UUID of the user or group."`
	Type string `json:"type" jsonschema:"USER or GROUP."`
}

AssigneeInput is one user/group assignment in a set_assignees op.

type Input

type Input struct {
	Assessment string      `` /* 167-byte string literal not displayed */
	Operations []Operation `` /* 258-byte string literal not displayed */
}

Input is the tool's typed input.

type ItemInput

type ItemInput struct {
	ID    string `json:"id" jsonschema:"The option's id, as defined by the template."`
	Value string `json:"value,omitempty" jsonschema:"The option's display value. Defaults to id if omitted."`
}

ItemInput is one selected option for an ITEMS (choice) answer.

type Operation

type Operation struct {
	Type OperationType `json:"type" jsonschema:"Required. One of: set_answer, set_status, set_name, set_owner, set_assignees, set_visibility."`

	// set_answer
	QuestionID string      `json:"questionId,omitempty" jsonschema:"For set_answer: the id of a question in the assessment's content."`
	Comments   string      `json:"comments,omitempty" jsonschema:"For set_answer: optional free-text comment to attach to the answer."`
	AnswerType string      `` /* 313-byte string literal not displayed */
	Items      []ItemInput `` /* 220-byte string literal not displayed */

	// set_answer (scalar types) / set_status / set_name / set_visibility use value.
	Value string `` /* 378-byte string literal not displayed */

	// set_owner
	UserID string `json:"userId,omitempty" jsonschema:"For set_owner: UUID of the user to set as the assessment owner."`

	// set_assignees
	Assignees []AssigneeInput `` /* 161-byte string literal not displayed */
}

Operation is a discriminated union: the 'type' field selects which other fields are interpreted. Unused fields are ignored.

type OperationResult

type OperationResult struct {
	Operation  OperationType `json:"operation"`
	Status     string        `json:"status" jsonschema:"'success' or 'error'."`
	QuestionID string        `json:"questionId,omitempty"`
	Value      string        `json:"value,omitempty"`
	Error      string        `json:"error,omitempty"`
}

OperationResult is the outcome of a single operation.

type OperationType

type OperationType string

OperationType enumerates the edits edit_assessment can perform.

const (
	OpSetAnswer     OperationType = "set_answer"
	OpSetStatus     OperationType = "set_status"
	OpSetName       OperationType = "set_name"
	OpSetOwner      OperationType = "set_owner"
	OpSetAssignees  OperationType = "set_assignees"
	OpSetVisibility OperationType = "set_visibility"
)

type Output

type Output struct {
	Status     OutputStatus        `` /* 190-byte string literal not displayed */
	Results    []OperationResult   `` /* 211-byte string literal not displayed */
	Assessment *clients.Assessment `json:"assessment,omitempty" jsonschema:"The assessment's state after the update. Present only on success."`
	Error      string              `` /* 201-byte string literal not displayed */
}

Output is the tool's typed output. Mirrors edit_asset: an overall status, per-operation results, the updated assessment on success, and an Error string for a whole-request failure.

type OutputStatus

type OutputStatus string

OutputStatus summarises the result of the call.

const (
	StatusSuccess OutputStatus = "success"
	StatusError   OutputStatus = "error"
)

Jump to

Keyboard shortcuts

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