name: get_pipeline_status
description: "Retrieve the current run status, latest execution log, and SLA compliance for a data pipeline"
when_to_use: "When monitoring pipeline health, diagnosing failures, or reporting on data freshness"
parameters:
  pipeline_id:
    type: string
    description: "Unique identifier of the pipeline to inspect"
    required: true
  include_logs:
    type: boolean
    description: "Whether to include the latest execution log output in the response"
    default: false
  last_n_runs:
    type: integer
    description: "Number of most recent runs to include in the run history"
    default: 5
returns:
  type: object
  description: "Pipeline health summary including status, SLA breaches, and recent run history"
  properties:
    pipeline_id:
      type: string
    current_status:
      type: string
      enum: [running, succeeded, failed, queued]
    last_success:
      type: string
    last_failure:
      type: string
    sla_breaches:
      type: integer
    recent_runs:
      type: array
      items:
        type: object
        properties:
          run_id:
            type: string
          status:
            type: string
          duration_s:
            type: integer
          started_at:
            type: string
