Skip to content

Add confidence parameter to issue mutation MCP tools - #2605

Merged
alondahari merged 1 commit into
mainfrom
alondahari/add-confidence-parameter
Jun 5, 2026
Merged

Add confidence parameter to issue mutation MCP tools#2605
alondahari merged 1 commit into
mainfrom
alondahari/add-confidence-parameter

Conversation

@alondahari

@alondaharialondahari commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Adds an optional confidence parameter to the three issue mutation MCP tools: update_issue_type, update_issue_labels, and set_issue_fields. The confidence level is a string enum ("low", "medium", "high") passed through to the REST/GraphQL API on every mutation call.

Changes

  • Renamed structs from WithRationale to WithIntent (labelWithIntent, issueTypeWithIntent) to better reflect they carry multiple intent signals
  • Added confidence schema property as a string enum with values low, medium, high:
    • high: clear signal or explicit user request
    • medium: reasonable inference with some ambiguity
    • low: best guess with limited signal
  • Updated tool descriptions to encourage LLMs to include confidence levels
  • Passes confidence in the API request body alongside rationale/suggest
  • Updated toolsnaps, tests, and docs

Testing

  • All unit tests pass (including new confidence-specific tests for all 3 tools)
  • Lint clean
  • Toolsnaps regenerated

Closes github/plan-track-agentic-toolkit#219

@alondahari
alondahari requested a review from a team as a code ownerJune 4, 2026 10:26
CopilotAI review requested due to automatic review settings June 4, 2026 10:26
CopilotAI reviewed Jun 4, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment threaddocs/feature-flags.md
- `pullNumber`: The pull request number (number, required)
- `repo`: Repository name (string, required)
- `reviewers`: GitHub usernames to request reviews from (string[], required)
- `reviewers`: GitHub usernames or ORG/team-slug team reviewers to request reviews from (string[], required)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to come from an unrelated change that probably didn't update the docs

@alondahari
alondahariforce-pushed the alondahari/add-confidence-parameter branch from 311380b to 7b01177CompareJune 4, 2026 10:35

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 6/8 changed files
  • Comments generated: 3

Comment threadpkg/github/issues_granular.go Outdated
SingleSelectOptionID *githubv4.ID `json:"singleSelectOptionId,omitempty"`
Delete *githubv4.Boolean `json:"delete,omitempty"`
Rationale *githubv4.String `json:"rationale,omitempty"`
Confidence *int `json:"confidence,omitempty"`
Comment threadpkg/github/issues_granular.go Outdated
Comment on lines +1120 to +1133
var confidence *int
if _, exists := fieldMap["confidence"]; exists {
c, err := OptionalIntParam(fieldMap, "confidence")
if err != nil {
return utils.NewToolResultError(err.Error()), nil, nil
}
if c < 0 || c > 100 {
return utils.NewToolResultError("confidence must be between 0 and 100"), nil, nil
}
confidence = &c
}
if confidence != nil {
input.Confidence = confidence
}
Comment threaddocs/feature-flags.md Outdated

- **update_issue_type** - Update Issue Type
- **Required OAuth Scopes**: `repo`
- `confidence`: How confident you are in this choice (0–100). 90–100: very high — clear signal or explicit user request. 70–89: high — strong signals, likely correct. 50–69: moderate — reasonable inference but ambiguous. 30–49: low — best guess, user review recommended. 0–29: very low — speculative. (number, optional)
Comment threaddocs/feature-flags.md Outdated

- **update_issue_type** - Update Issue Type
- **Required OAuth Scopes**: `repo`
- `confidence`: How confident you are in this choice (0–100). 90–100: very high — clear signal or explicit user request. 70–89: high — strong signals, likely correct. 50–69: moderate — reasonable inference but ambiguous. 30–49: low — best guess, user review recommended. 0–29: very low — speculative. (number, optional)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the value of adding these range categories?
They seem somewhat arbitrary and don't actually exist anywhere in the code.
We could think about the confidence be something like an enum (with values mapped to named categories), but since we're using a numeric range, simply overlaying arbitrary ranges (which aren't enforced/referenced anywhere in the code) doesn't seem like it makes a lot of sense

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that we will have the same buckets as a guide for maintainers when setting the thresholds. I'm afraid that without any guidance it would be totally unpredictable. Do you think using an enum instead would be better?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think so. i don't really see a reason to care about a difference between a confidence value of 74 vs 76...
I think a few (named) categories would make more sense.
we could keep the 0-100 range on the backend, and use categories in all of the API/UI endpoints (which we would translate to a 0-100 number). That way we can add more fine-grained categories later if we want.

Add an optional confidence integer parameter (0–100) to update_issue_type,
update_issue_labels, and set_issue_fields MCP tools. The confidence score
is passed through to the REST/GraphQL API on mutation calls.
- Rename structs to WithIntent (labelWithIntent, issueTypeWithIntent)
- Add confidence schema property (integer, min 0, max 100) with prompt
guidance describing what different confidence levels represent
- Update tool descriptions to encourage including confidence scores
- Pass confidence in the API request body alongside rationale/suggest
Closesgithub/plan-track-agentic-toolkit#219
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alondahari
alondahariforce-pushed the alondahari/add-confidence-parameter branch from 7b01177 to 7e2388eCompareJune 4, 2026 16:04
@alondahari
alondahari merged commit 457f599 into mainJun 5, 2026
19 checks passed
@alondahari
alondahari deleted the alondahari/add-confidence-parameter branch June 5, 2026 14:04
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@alondahari@omgitsads@boazreicher@h5dh2gy26z-sys