Skip to content

MCP: invalid cursor returns INTERNAL_ERROR, summaries count the wrong thing, and links.ui points at the API host #3597

Closed

Description

@integry

Problem

  1. get_pull_request_discussion {repository, pullRequest, order:"newest", cursor:"garbage"} returns {"error":{"code":"INTERNAL_ERROR","status":500}}. Sibling tools (list_notifications, list_repository_events, wait_goal) return a 400 INVALID_INPUT/CURSOR_INVALID.
  2. Result summaries count the first array-valued property of the result, whatever it is (packages/api/mcp/presentation.ts, Object.values(result).find(Array.isArray)): get_cost_breakdown groupBy:["outcome"] with 2 rows says "1 items in this page" (it counts group_by); list_pull_requests returning 2 PRs says "1 items" (counts repositories); get_pull_request says "0 items in this page"; get_pull_request_readiness says "9 items in this page" (the gates) instead of the verdict; get_repository_configuration says "0 items". Also "1 items".
  3. links.ui is the API origin for most tools (presentation.ts, fallback ui: origin), e.g. "ui":"https://api.example", which serves no UI. Entity links correctly use the frontend URL.
  4. list_visual_previews, get_agent_activity and get_comment_attachment answer a missing one-of argument with plain text "Input validation error: …" instead of the {"error":{code,…}} envelope.
  5. An unknown pull request gives GITHUB_NOT_FOUND with the message "Not Found"; other tools give NOT_FOUND with a sentence.
  6. get_task_changes {detail:"diff", path:"../../.env"} returns files: [] instead of an invalid-path error; list_repository_events.planId accepts any string while list_plan_blocked_events.planId requires a UUID.
  7. get_pull_request_readiness takes number; every other PR tool takes pullRequest.

Expected / acceptance criteria

  • 1: an undecodable cursor is a 400 with the same error code the other cursor tools use.
  • 2: list tools state the count of the entity they list (singular/plural correct); single-object reads summarize the object (get_pull_request_readiness: the verdict, e.g. "PR Epic: Claude-Powered GitHub Issue Processor - Stage 8: Quality Assurance Framework #12 is waiting: checks pending"; get_pull_request: number, title, state). No tool reports "0 items" for a successful single read.
  • 3: links.ui is the configured frontend URL (the same base the entity links use) for every tool; omitted when no frontend URL is configured.
  • 4, 5: the standard error envelope with a sentence message.
  • 6: path traversal in path is rejected like read_repository_file does; planId is validated as a UUID in both tools.
  • 7: get_pull_request_readiness accepts pullRequest as well as number (keep number working; document pullRequest).
  • Tests for each point.

Implementation

packages/api/mcp/presentation.ts (summary and links), the discussion tool's cursor decoding, and the three tools' input validation under packages/api/mcp/. Update docs/mcp.md where parameter names or error codes are listed.

Notes

Do not rename or remove existing parameters or result fields; only add and correct.

Activity

  1. propr-dev commented on Nov 17, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3597/claude-opus-5-5-mcp-invalid-cursor-return-20261117-0119-3gq
    • Base Branch: 3595-epic-0-9-h9l
    • Worktree: issue-3597-20261117-0119-claude-opus-5-5-3gq

    🔍 Track Task Execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions