GranularUpdateIssueLabels creates a tool to update an issue's labels.
(t translations.TranslationHelperFunc)
| 281 | |
| 282 | // GranularUpdateIssueLabels creates a tool to update an issue's labels. |
| 283 | func GranularUpdateIssueLabels(t translations.TranslationHelperFunc) inventory.ServerTool { |
| 284 | st := NewTool( |
| 285 | ToolsetMetadataIssues, |
| 286 | mcp.Tool{ |
| 287 | Name: "update_issue_labels", |
| 288 | Description: t("TOOL_UPDATE_ISSUE_LABELS_DESCRIPTION", "Update the labels of an existing issue. This replaces the current labels with the provided list. When setting values, include a confidence level (LOW, MEDIUM, or HIGH) reflecting how certain you are about the choice."), |
| 289 | Annotations: &mcp.ToolAnnotations{ |
| 290 | Title: t("TOOL_UPDATE_ISSUE_LABELS_USER_TITLE", "Update Issue Labels"), |
| 291 | ReadOnlyHint: false, |
| 292 | DestructiveHint: jsonschema.Ptr(false), |
| 293 | OpenWorldHint: jsonschema.Ptr(true), |
| 294 | }, |
| 295 | InputSchema: &jsonschema.Schema{ |
| 296 | Type: "object", |
| 297 | Properties: map[string]*jsonschema.Schema{ |
| 298 | "owner": { |
| 299 | Type: "string", |
| 300 | Description: "Repository owner (username or organization)", |
| 301 | }, |
| 302 | "repo": { |
| 303 | Type: "string", |
| 304 | Description: "Repository name", |
| 305 | }, |
| 306 | "issue_number": { |
| 307 | Type: "number", |
| 308 | Description: "The issue number to update", |
| 309 | Minimum: jsonschema.Ptr(1.0), |
| 310 | }, |
| 311 | "labels": { |
| 312 | Type: "array", |
| 313 | Description: "Labels to apply to this issue.", |
| 314 | Items: &jsonschema.Schema{ |
| 315 | OneOf: []*jsonschema.Schema{ |
| 316 | {Type: "string", Description: "Label name"}, |
| 317 | { |
| 318 | Type: "object", |
| 319 | Properties: map[string]*jsonschema.Schema{ |
| 320 | "name": { |
| 321 | Type: "string", |
| 322 | Description: "Label name", |
| 323 | }, |
| 324 | "rationale": { |
| 325 | Type: "string", |
| 326 | Description: "One concise sentence explaining what specifically about the issue led you to choose this label. " + |
| 327 | "State the concrete signal (e.g. 'Reports a crash when saving' → bug).", |
| 328 | MaxLength: jsonschema.Ptr(280), |
| 329 | }, |
| 330 | "confidence": { |
| 331 | Type: "string", |
| 332 | Description: "How confident you are in this choice. Use 'HIGH' for clear signal or explicit user request, 'MEDIUM' for reasonable inference with some ambiguity, 'LOW' for best guess with limited signal.", |
| 333 | Enum: []any{"LOW", "MEDIUM", "HIGH"}, |
| 334 | }, |
| 335 | "is_suggestion": { |
| 336 | Type: "boolean", |
| 337 | Description: "If true, this label is sent to the API as a suggestion (suggest:true) rather than an applied label. " + |
| 338 | "Whether the label is applied or recorded as a proposal is determined by the API.", |
| 339 | }, |
| 340 | }, |