> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Job Results And Status

> Get current status and result payload for a submitted job.

Use this tool after any asynchronous MCP submit endpoint returns a
``job_id`` and the caller needs current state or terminal results. When the
job is still running, the response remains the full job object plus MCP
context, not a polling-only acknowledgment.

When to Use:
    - Call this after any asynchronous MCP submit endpoint returns a
      ``job_id``.
    - Call this when the workflow needs current status, terminal outputs,
      or the MCP context summary for a known job.

Constraints:
    - This route is for status lookup, not discovery.
    - Result shape depends on job family. For example, non-dry run
      ``RunJob`` responses may surface raw ``quantum_results`` in the MCP
      context field instead of a textual summary.

Notes:
    - If the caller does not yet know the job ID, use experiment or
      circuit job-listing tools first.
    - Compression, transpilation, data-loading, analytics, and run jobs can
      all appear here with different result semantics.

Args:
    job_id: Job identifier returned by a prior MCP submission or listing
        endpoint.
    user: Authenticated user resolved from the API key.
    db: Active database session.

Returns:
    The resolved job object enriched with MCP context text or result data.

Raises:
    HTTPException: Raised with ``404`` when the job cannot be found for the
        caller scope.



## OpenAPI

````yaml https://api.haiqu.ai/openapi.json get /ai/jobs/{job_id}/results
openapi: 3.1.0
info:
  title: Haiqu API
  summary: Haiqu RESTful API service.
  description: Cloud service providing the access to Haiqu cloud runtime
  contact:
    name: Haiqu Inc.
    url: https://haiqu.ai/
    email: info@haiqu.ai
  version: 1.4.0
servers: []
security: []
paths:
  /ai/jobs/{job_id}/results:
    get:
      summary: Get Job Results And Status
      description: >-
        Get current status and result payload for a submitted job.


        Use this tool after any asynchronous MCP submit endpoint returns a

        ``job_id`` and the caller needs current state or terminal results. When
        the

        job is still running, the response remains the full job object plus MCP

        context, not a polling-only acknowledgment.


        When to Use:
            - Call this after any asynchronous MCP submit endpoint returns a
              ``job_id``.
            - Call this when the workflow needs current status, terminal outputs,
              or the MCP context summary for a known job.

        Constraints:
            - This route is for status lookup, not discovery.
            - Result shape depends on job family. For example, non-dry run
              ``RunJob`` responses may surface raw ``quantum_results`` in the MCP
              context field instead of a textual summary.

        Notes:
            - If the caller does not yet know the job ID, use experiment or
              circuit job-listing tools first.
            - Compression, transpilation, data-loading, analytics, and run jobs can
              all appear here with different result semantics.

        Args:
            job_id: Job identifier returned by a prior MCP submission or listing
                endpoint.
            user: Authenticated user resolved from the API key.
            db: Active database session.

        Returns:
            The resolved job object enriched with MCP context text or result data.

        Raises:
            HTTPException: Raised with ``404`` when the job cannot be found for the
                caller scope.
      operationId: get_job_results_and_status
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextBaseJobModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyQuery: []
        - APIKeyHeader: []
components:
  schemas:
    ContextBaseJobModel:
      properties:
        id:
          type: string
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        user_id:
          type: integer
          title: User Id
        experiment_id:
          type: string
          title: Experiment Id
        status:
          $ref: '#/components/schemas/JobStatus'
        job_type:
          $ref: '#/components/schemas/JobType'
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          default: Haiqu OS
        creation_date:
          type: string
          format: date-time
          title: Creation Date
        run_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Run Date
        finish_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finish Date
        logs:
          anyOf:
            - type: string
            - type: 'null'
          title: Logs
        quality:
          anyOf:
            - type: number
            - type: 'null'
          title: Quality
        info:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Info
        time:
          anyOf:
            - type: number
            - type: 'null'
          title: Time
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: 'null'
          title: Parameters
        context:
          anyOf:
            - type: string
            - items: {}
              type: array
          title: Context
          description: >-
            context string or raw result list, depending on job family and
            status. Run jobs may return raw `quantum_results` here.
      type: object
      required:
        - id
        - user_id
        - experiment_id
        - status
        - job_type
        - creation_date
        - context
      title: ContextBaseJobModel
      description: |-
        Extend base job model with MCP context payload.

        Attributes:
            context: context string or raw result list, depending on
                job family and status.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobStatus:
      type: string
      enum:
        - Submitted
        - Initializing
        - Queued
        - Validating
        - Running
        - Cancelled
        - Done
        - Error
      title: JobStatus
      description: Class for job status.
    JobType:
      type: string
      enum:
        - User local job
        - Analytics
        - Device specific analytics
        - Data Loading
        - Hybrid
        - Run
        - State Compression
        - Transpilation
        - Variational
        - Pretraining
        - SKQD
      title: JobType
      description: Class for job types.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyQuery:
      type: apiKey
      in: query
      name: HAIQU_API_KEY
    APIKeyHeader:
      type: apiKey
      in: header
      name: authorization

````