Skip to content

issue_read: support response field filtering (fields/select) #3959

Backlog

Description

@MBanucu

Describe the feature or problem you’d like to solve

issue_read has no way to select which response fields are returned. Every method returns the full payload: get includes the complete issue body, and get_comments includes every comment body. This is inconsistent with the other issue tools (list_issues and search_issues both accept fields) and with list_pull_requests / search_pull_requests, and it is the same gap #3286 reports for pull_request_read.

Large issues are common (stack traces, debug logs, long design docs). In an OpenCode 2.4.1 session using the hosted endpoint, a single issue_read call on two bug reports returned multiple KB of log text that the caller did not need. Reading a handful of issues can consume a large part of the model context before any work starts.

Prior minimal-type work (#2023 / #2025, PRs #2022 / #2024) reduced the baseline payload, but callers still cannot choose the fields they actually need.

Proposed solution

Add a fields (or select) parameter to issue_read, scoped per method:

  • get: number, title, state, state_reason, user.login, labels, assignees, milestone, created_at, updated_at, closed_at, html_url, body (opt-in; optionally a body_max_length).
  • get_comments: id, user.login, created_at, updated_at, html_url, body (body opt-in / truncatable).
  • get_sub_issues: number, title, state, html_url.
  • get_parent: number, title, state, url, repository.
  • get_labels: name, color, description.

Defaults should stay backward compatible (full response when fields is omitted). Invalid field names should return the allowed set, as the list tools already do.

Example prompts or workflows (for tools/toolsets only)

  • "Triage the 40 newest open issues in this repo: title, labels, assignee, updated_at, and URL only." — one list_issues call plus targeted issue_read calls without bodies.
  • "Summarize what maintainers said in issue Issue: Fix incorrect VS Code installation URL (both buttons point to Insiders) #123, but omit the 200-line stack trace in the body." — issue_read(method: get_comments, fields: [user.login, created_at, body]).
  • "Build a table of issue numbers, titles, states, and links for the release notes." — no issue bodies needed.
  • "Read this issue's metadata and labels without pulling its full design document into context."

Additional context

Related: #3286 (pull_request_read field filtering), #2023 / #2025 (closed minimal-type work), #2242 (JSON payload inflation), #3603 (payload size limits).

Environment: OpenCode 2.4.1, hosted endpoint https://api.githubcopilot.com/mcp/, toolsets repos,issues,pull_requests,actions.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions