Skip to content

Add confidence parameter to issue mutation MCP tools#2605

Open
alondahari wants to merge 1 commit into
mainfrom
alondahari/add-confidence-parameter
Open

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

Conversation

@alondahari
Copy link
Copy Markdown
Member

Summary

Adds an optional confidence integer parameter (0–100) to the three issue mutation MCP tools: update_issue_type, update_issue_labels, and set_issue_fields. The confidence score is 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 (integer, min 0, max 100) with prompt guidance in the description explaining what different confidence levels represent:
    • 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
  • Updated tool descriptions to encourage LLMs to include confidence scores
  • Passes confidence in the API request body alongside rationale/suggest
  • Updated toolsnaps and docs

Testing

  • All unit tests pass
  • Lint clean
  • Toolsnaps regenerated

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

@alondahari alondahari requested a review from a team as a code owner June 4, 2026 10:26
Copilot AI review requested due to automatic review settings June 4, 2026 10:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 thread docs/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
Member Author

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

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

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alondahari alondahari force-pushed the alondahari/add-confidence-parameter branch from 311380b to 7b01177 Compare June 4, 2026 10:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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

SingleSelectOptionID *githubv4.ID `json:"singleSelectOptionId,omitempty"`
Delete *githubv4.Boolean `json:"delete,omitempty"`
Rationale *githubv4.String `json:"rationale,omitempty"`
Confidence *int `json:"confidence,omitempty"`
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 thread docs/feature-flags.md

- **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 thread docs/feature-flags.md

- **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
Member Author

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We discussed this on Slack and decided to go ahead with this configuration for experimentation for now. We can always change it in the future.

Sign up for free to 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.

3 participants