Skip to content

fix(mcp): prioritize exact match in label name resolution (PUNT-405)#484

Open
jmynes wants to merge 2 commits into
mainfrom
fix/punt-405-mcp-label-exact-match
Open

fix(mcp): prioritize exact match in label name resolution (PUNT-405)#484
jmynes wants to merge 2 commits into
mainfrom
fix/punt-405-mcp-label-exact-match

Conversation

@jmynes

@jmynes jmynes commented Mar 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract findLabelByName() helper that uses tiered matching: exact match first, substring fallback second
  • Replace all 4 label lookup sites in mcp/src/tools/labels.ts (update_label, delete_label, add_label_to_ticket, remove_label_from_ticket)
  • Fixes ambiguous matches when label names overlap (e.g., searching for "ux" no longer incorrectly matches "UI/UX" first)

Test plan

  • With labels "ux" and "UI/UX", verify delete_label with name "ux" targets the exact "ux" label
  • Verify substring fallback still works (e.g., searching "bug" still matches "bugfix" if no exact "bug" label exists)
  • Test all four affected tools: update_label, delete_label, add_label_to_ticket, remove_label_from_ticket

🤖 Generated with Claude Code

Extract findLabelByName() helper that tries exact match first, then
falls back to case-insensitive substring matching. Fixes ambiguous
matches when label names overlap (e.g., "ux" incorrectly matching
"UI/UX" instead of the exact "ux" label).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jmynes jmynes self-assigned this Mar 24, 2026
…el lookup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant