feat: issue_list_comments tool — read issue comments not just body #32

Closed
opened 2026-05-27 16:34:25 +00:00 by mathias · 1 comment
Owner

Summary

issue_get returns the issue body and metadata but not comments. This means agents cannot read discussion threads, progress updates, or findings posted as comments on issues — only the original issue body.

Current behaviour

// issue_get returns:
{
  "number": 80,
  "title": "...",
  "body": "...",  // original issue body only
  "state": "open",
  ...
}
// Comments from the discussion thread: not included

Expected behaviour

Either:

Option A — include comments in issue_get response (simple)
Add a comments array to the issue_get response with all comment bodies and metadata.

Option B — separate issue_list_comments tool (cleaner)

tool: issue_list_comments
params:
  owner:  string
  name:   string
  number: integer

Returns array of comments with: id, body, created_at, updated_at.

Recommendation: Option B — keeps issue_get lightweight, comments on demand.

Gitea API

GET /api/v1/repos/{owner}/{repo}/issues/{index}/comments

Returns array of comment objects with: id, body, html_url, created_at, updated_at, user.

Required token permission

read:issue — same as issue_get, no new permissions needed.

Risk classification

LOW — read-only.

Implementation notes

  • Follow pattern of issue_get.go
  • No allowlist check on repo name, only on owner
  • Test cases: issue with comments, issue with no comments (empty array), issue not found

Motivation

Discovered 2026-05-27: Koala-Claude posted a progress update as a comment on infra #80.
Claude.ai could not read the comment via issue_get — had to ask the user to paste it manually.
Agents posting progress updates as comments is a common pattern; the reading side must match.

Related

  • Pairs with issue_get (#20) and issue_close (#30)
  • Part of gitea-mcp v0.3 batch
## Summary `issue_get` returns the issue body and metadata but not comments. This means agents cannot read discussion threads, progress updates, or findings posted as comments on issues — only the original issue body. ## Current behaviour ```go // issue_get returns: { "number": 80, "title": "...", "body": "...", // original issue body only "state": "open", ... } // Comments from the discussion thread: not included ``` ## Expected behaviour Either: **Option A — include comments in issue_get response (simple)** Add a `comments` array to the `issue_get` response with all comment bodies and metadata. **Option B — separate issue_list_comments tool (cleaner)** ``` tool: issue_list_comments params: owner: string name: string number: integer ``` Returns array of comments with: id, body, created_at, updated_at. **Recommendation: Option B** — keeps issue_get lightweight, comments on demand. ## Gitea API `GET /api/v1/repos/{owner}/{repo}/issues/{index}/comments` Returns array of comment objects with: id, body, html_url, created_at, updated_at, user. ## Required token permission `read:issue` — same as issue_get, no new permissions needed. ## Risk classification **LOW** — read-only. ## Implementation notes - Follow pattern of `issue_get.go` - No allowlist check on repo name, only on owner - Test cases: issue with comments, issue with no comments (empty array), issue not found ## Motivation Discovered 2026-05-27: Koala-Claude posted a progress update as a comment on infra #80. Claude.ai could not read the comment via `issue_get` — had to ask the user to paste it manually. Agents posting progress updates as comments is a common pattern; the reading side must match. ## Related - Pairs with `issue_get` (#20) and `issue_close` (#30) - Part of gitea-mcp v0.3 batch
Author
Owner

Implemented in 3c1ca7d. Added issue_list_comments tool + Client.ListIssueComments calling GET /api/v1/repos/{owner}/{repo}/issues/{index}/comments. Tests cover populated list, empty array, 404, and allowlist rejection. task check green. Closing.

Implemented in 3c1ca7d. Added `issue_list_comments` tool + `Client.ListIssueComments` calling `GET /api/v1/repos/{owner}/{repo}/issues/{index}/comments`. Tests cover populated list, empty array, 404, and allowlist rejection. `task check` green. Closing.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/gitea-mcp#32