fix(issue_label): schema wrongly required labels, blocking label_ids-only callers (#52 review finding)
Independent adversarial review of #52 (v0.8.0) caught a schema/implementation mismatch: the advertised InputSchema marked "labels" as required, but Call already treated labels/label_ids as either-or. An MCP client that validates arguments against the advertised schema before dispatch would reject a label_ids-only call as invalid even though the code was written to serve it — and that path had zero test coverage either way. Dropped "labels" from the required array (owner/repo/number remain required); runtime validation already correctly requires at least one of labels/label_ids. Added TestIssueLabelAppliesByIDOnly (asserts ListLabels is never called when IDs are already known) and a schema-lock test for the fixed contract. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,10 +29,10 @@ func (t *IssueLabel) Descriptor() registry.ToolDescriptor {
|
||||
"owner":{"type":"string"},
|
||||
"repo":{"type":"string"},
|
||||
"number":{"type":"integer","minimum":1},
|
||||
"labels":{"type":"array","items":{"type":"string"}},
|
||||
"label_ids":{"type":"array","items":{"type":"integer"}}
|
||||
"labels":{"type":"array","items":{"type":"string"},"description":"Label names to resolve and apply. Either labels or label_ids is required."},
|
||||
"label_ids":{"type":"array","items":{"type":"integer"},"description":"Label IDs to apply directly, skipping name resolution. Either labels or label_ids is required."}
|
||||
},
|
||||
"required":["owner","repo","number","labels"]
|
||||
"required":["owner","repo","number"]
|
||||
}`),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user