fix(mcp): wrap list payloads, rename shadowed ref fields (v0.4.1-tupo) #9

Open
qwolff wants to merge 0 commits from fix/mcp-list-tools into main
Owner

Hotfix for v0.4.0-tupo.

Release-blocking fixes

Four MCP tools were broken on first call — the Go MCP SDK rejects top-level arrays in `structuredContent`:

Tool Was Now
`pr_list` `expected record, received array` `{items, count}`
`issue_list` `expected record, received null` `{items, count}`
`label_list` `expected record, received null` `{items, count}`
`search` `expected record, received array` `{items, count}`

Other MCP hygiene

  • `pr_read` / `issue_read` emit `comments`/`reviews`/`checks` as arrays even when empty — callers can now tell "no comments" from "section skipped".
  • Suppress `mergeable` on merged or closed PRs (Gitea returns `false` post-merge, which LLMs read as "has conflicts").
  • Rename response field `ref` → `git_ref` on `run_read` / `file_read` to stop shadowing the tool input `ref` (= `owner/repo`).

Verification

Smoke-tested by piping MCP JSON-RPC directly into the built binary against `tu-po/fgj`. All four previously-broken list tools now return well-formed `{items, count}` records.

Bumps version to `0.4.1-tupo`.

🤖 Generated with Claude Code

Hotfix for v0.4.0-tupo. ## Release-blocking fixes Four MCP tools were broken on first call — the Go MCP SDK rejects top-level arrays in \`structuredContent\`: | Tool | Was | Now | |------|-----|-----| | \`pr_list\` | \`expected record, received array\` | \`{items, count}\` | | \`issue_list\` | \`expected record, received null\` | \`{items, count}\` | | \`label_list\` | \`expected record, received null\` | \`{items, count}\` | | \`search\` | \`expected record, received array\` | \`{items, count}\` | ## Other MCP hygiene - \`pr_read\` / \`issue_read\` emit \`comments\`/\`reviews\`/\`checks\` as arrays even when empty — callers can now tell "no comments" from "section skipped". - Suppress \`mergeable\` on merged or closed PRs (Gitea returns \`false\` post-merge, which LLMs read as "has conflicts"). - Rename response field \`ref\` → \`git_ref\` on \`run_read\` / \`file_read\` to stop shadowing the tool input \`ref\` (= \`owner/repo\`). ## Verification Smoke-tested by piping MCP JSON-RPC directly into the built binary against \`tu-po/fgj\`. All four previously-broken list tools now return well-formed \`{items, count}\` records. Bumps version to \`0.4.1-tupo\`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(mcp): wrap list payloads, rename shadowed ref fields, emit empty sections
All checks were successful
CI / build (pull_request) Successful in 54s
CI / lint (pull_request) Successful in 55s
CI / test (pull_request) Successful in 56s
1e205ee0de
Hotfix for v0.4.0-tupo: the four list-shaped tools were unusable because
they returned top-level arrays (or nil) for structuredContent, which the
Go MCP SDK validates and rejects. Wrap everything in {items, count}.

Also:
- pr_read / issue_read now always emit comments/reviews/checks as arrays
  (empty rather than omitted) so callers can distinguish "none" from
  "skipped".
- Suppress mergeable on merged/closed PRs — Gitea returns false post-merge
  and LLMs readily misread that as "has conflicts".
- Rename run_read and file_read response field 'ref' → 'git_ref' to stop
  shadowing the tool input 'ref' (owner/repo).

Smoke-tested via direct stdio JSON-RPC against the real Forgejo instance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All checks were successful
CI / build (pull_request) Successful in 54s
CI / lint (pull_request) Successful in 55s
CI / test (pull_request) Successful in 56s
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/mcp-list-tools:fix/mcp-list-tools
git switch fix/mcp-list-tools

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/mcp-list-tools
git switch fix/mcp-list-tools
git rebase main
git switch main
git merge --ff-only fix/mcp-list-tools
git switch fix/mcp-list-tools
git rebase main
git switch main
git merge --no-ff fix/mcp-list-tools
git switch main
git merge --squash fix/mcp-list-tools
git switch main
git merge --ff-only fix/mcp-list-tools
git switch main
git merge fix/mcp-list-tools
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwolff/fgj!9
No description provided.