Prefect · Capability

Prefect Cloud API — Task Run States

Prefect Cloud API — Task Run States. 2 operations. Lead operation: Read Task Run States. Self-contained Naftiko capability covering one Prefect business surface.

Run with Naftiko PrefectTask Run States

What You Can Do

GET
Readtaskrunstatesapiaccountsaccountidworkspacesworkspaceidtaskrunstatesget — Read Task Run States
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-run-states
GET
Readtaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunstatesidget — Read Task Run State
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-run-states/{id}

MCP Tools

read-task-run-states

Read Task Run States

read-only idempotent
read-task-run-state

Read Task Run State

read-only idempotent

Capability Spec

prefect-task-run-states.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Prefect Cloud API — Task Run States
  description: 'Prefect Cloud API — Task Run States. 2 operations. Lead operation: Read Task Run States. Self-contained Naftiko
    capability covering one Prefect business surface.'
  tags:
  - Prefect
  - Task Run States
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PREFECT_API_KEY: PREFECT_API_KEY
capability:
  consumes:
  - type: http
    namespace: prefect-task-run-states
    baseUri: ''
    description: Prefect Cloud API — Task Run States business capability. Self-contained, no shared references.
    resources:
    - name: api-accounts-account_id-workspaces-workspace_id-task_run_states
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_run_states/
      operations:
      - name: readtaskrunstatesapiaccountsaccountidworkspacesworkspaceidtaskrunstatesget
        method: GET
        description: Read Task Run States
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: task_run_id
          in: query
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-task_run_states-id
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_run_states/{id}
      operations:
      - name: readtaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunstatesidget
        method: GET
        description: Read Task Run State
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: string
          description: The task run state id
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
  exposes:
  - type: rest
    namespace: prefect-task-run-states-rest
    port: 8080
    description: REST adapter for Prefect Cloud API — Task Run States. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-run-states
      name: api-accounts-account-id-workspaces-workspace-id-task-run-states
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_run_states.
      operations:
      - method: GET
        name: readtaskrunstatesapiaccountsaccountidworkspacesworkspaceidtaskrunstatesget
        description: Read Task Run States
        call: prefect-task-run-states.readtaskrunstatesapiaccountsaccountidworkspacesworkspaceidtaskrunstatesget
        with:
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          task_run_id: rest.task_run_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-run-states/{id}
      name: api-accounts-account-id-workspaces-workspace-id-task-run-states-id
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_run_states-id.
      operations:
      - method: GET
        name: readtaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunstatesidget
        description: Read Task Run State
        call: prefect-task-run-states.readtaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunstatesidget
        with:
          id: rest.id
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: prefect-task-run-states-mcp
    port: 9090
    transport: http
    description: MCP adapter for Prefect Cloud API — Task Run States. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: read-task-run-states
      description: Read Task Run States
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-run-states.readtaskrunstatesapiaccountsaccountidworkspacesworkspaceidtaskrunstatesget
      with:
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        task_run_id: tools.task_run_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: read-task-run-state
      description: Read Task Run State
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-run-states.readtaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunstatesidget
      with:
        id: tools.id
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.