name: github-issue-get
description: Get GitHub issue details, body text, and optional comments. Use when users want to read issue content, inspect discussion context, or fetch issue data before another change. Accept issue identifiers as a number, #number, or issue URL, and expand Gist-backed attachments only when that extra content is useful.
GitHub Issue Get
Fetch the smallest issue payload that satisfies the request.
Goal
- Outcome: Return the issue fields the user needs (body, comments, metadata) without over-fetching.
- Safety: Expand Gists only when useful; avoid leaking attachment contents broadly.
Workflow
- Parse the target issue identifier. Accept
123,#123, or a full GitHub issue URL, then normalize it to the bare issue number. - Choose the narrowest output mode that matches the user request:
- Use
--body-onlywhen only the issue body text is needed. - Use
--include-commentswhen the user needs discussion context. - Keep the default JSON form for general inspection or downstream processing.
- Read
references/output-modes.mdif you need the full mode matrix.
- Use
- Control Gist expansion deliberately:
- Keep the default expansion behavior when the issue likely references attached files and the user needs their contents.
- Use
--no-expand-gistwhen only issue metadata or quick inspection is needed.
- Fetch the issue. Illustrative (host CLI):
agent-tools github get-issue 123 --json
agent-tools github get-issue 123 --include-comments --json
agent-tools github get-issue 123 --body-only
- Summarize the result for the user instead of pasting raw JSON unless they explicitly ask for the machine-readable output.
- If Gist content is returned, surface the important attached text and note where it came from.
Guardrails
- Normalize the issue identifier before building any request.
- Prefer
--body-onlyfor follow-on edit workflows that only need the current body text. - Prefer
--include-commentsonly when the user asks for comments or discussion context. - Do not pay the cost of Gist expansion when the user only needs high-level issue metadata.
- If setup, auth, or repository configuration is missing, read
references/setup.md.