name: use-correct-github-review-comment-enums description: Enforce schema-correct enum values when posting GitHub PR review comments via MCP tools. Use when creating inline review comments or handling tool validation errors for review-thread parameters.
Goal
Prevent avoidable GitHub MCP tool failures caused by invalid enum values or casing in review-comment payloads.
When to Use
- You call
mcp__github__add_comment_to_pending_review. - You create or submit PR review comments with enum fields such as
subjectTypeorside. - A prior tool call failed with GraphQL validation mentioning enum mismatch.
Rules
- Validate enum fields before sending:
subjectTypemust beLINEorFILE.sideandstartSideshould useLEFTorRIGHTwhen present.
- Prefer
subjectType: LINEfor inline code comments. - Include
pathandlinefor inline comments; usesubjectType: FILEonly for file-level comments. - If a validation error reports enum mismatch, retry once with corrected enum casing/values without changing comment meaning.
- Do not repeat retries beyond one automatic correction attempt.
- Keep review text unchanged while fixing transport/schema fields.
Procedure
- Build comment payload and preflight-check enum fields.
- Send tool call.
- If response contains enum-validation error:
- map invalid enum values to valid constants (
LINE/FILE,LEFT/RIGHT), - resend exactly once.
- Confirm comment presence by reading review comments after successful submission.
Quick Reference
- Correct:
subjectType: "LINE" - Incorrect:
subjectType: "line"