capability_id: pr.view
version: "1.0.0"
description: Fetch one pull request by number.
input_schema:
  type: object
  required: [owner, name, prNumber]
  properties:
    owner: { type: string, minLength: 1 }
    name: { type: string, minLength: 1 }
    prNumber: { type: integer, minimum: 1 }
    exclude:
      type: array
      items: { type: string, enum: [body] }
      description: "Fields to strip from the output. Currently supports 'body'."
  additionalProperties: false
output_schema:
  type: object
  required: [id, number, title, state, url, labels]
  properties:
    id: { type: string, minLength: 1 }
    number: { type: integer, minimum: 1 }
    title: { type: string }
    state: { type: string }
    url: { type: string, minLength: 1 }
    body: { type: string }
    labels: { type: array, items: { type: string } }
  additionalProperties: false
routing:
  preferred: graphql
  fallbacks: [cli]
  notes:
    - Prefer GraphQL for structured fetch; CLI fallback if gh auth unavailable.
graphql:
  operationName: PrView
  operationType: query
  documentPath: src/gql/operations/pr-view.graphql
cli:
  command: pr view
  jsonFields: [id, number, title, state, url, body, labels]
