Prefect · Capability

Prefect Cloud API — Task Runs

Prefect Cloud API — Task Runs. 14 operations. Lead operation: Create Task Run. Self-contained Naftiko capability covering one Prefect business surface.

Run with Naftiko PrefectTask Runs

What You Can Do

POST
Createtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunspost — Create Task Run
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs
POST
Counttaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunscountpost — Count Task Runs
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/count
POST
Readtaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunsfilterpost — Read Task Runs
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/filter
POST
Taskrunhistoryapiaccountsaccountidworkspacesworkspaceidtaskrunshistorypost — Task Run History
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/history
POST
Paginatetaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunspaginatepost — Paginate Task Runs
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/paginate
DELETE
Deletetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsiddelete — Delete Task Run
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}
PATCH
Updatetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidpatch — Update Task Run
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}
GET
Readtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidget — Read Task Run
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}
GET
Gettaskrunartifactsapiaccountsaccountidworkspacesworkspaceidtaskrunsidartifactsget — Get Task Run Artifacts
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/artifacts
GET
Gettaskrunmaterializationsapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsmaterializationsget — Get Task Run Materializations
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/assets/materializations
GET
Gettaskrunreferencesapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsreferencesget — Get Task Run References
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/assets/references
POST
Settaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunsidsetstatepost — Set Task Run State
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/set-state
POST
Readtaskruncountsbystateapiaccountsaccountidworkspacesworkspaceiduitaskrunscountpost — Read Task Run Counts By State
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/task-runs/count
POST
Readdashboardtaskruncountsapiaccountsaccountidworkspacesworkspaceiduitaskrunsdashboardcountspost — Read Dashboard Task Run Counts
/v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/task-runs/dashboard/counts

MCP Tools

create-task-run

Create Task Run

count-task-runs

Count Task Runs

read-task-runs

Read Task Runs

task-run-history

Task Run History

paginate-task-runs

Paginate Task Runs

delete-task-run

Delete Task Run

idempotent
update-task-run

Update Task Run

idempotent
read-task-run

Read Task Run

read-only idempotent
get-task-run-artifacts

Get Task Run Artifacts

read-only idempotent
get-task-run-materializations

Get Task Run Materializations

read-only idempotent
get-task-run-references

Get Task Run References

read-only idempotent
set-task-run-state

Set Task Run State

read-task-run-counts-state

Read Task Run Counts By State

read-dashboard-task-run-counts

Read Dashboard Task Run Counts

Capability Spec

prefect-task-runs.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Prefect Cloud API — Task Runs
  description: 'Prefect Cloud API — Task Runs. 14 operations. Lead operation: Create Task Run. Self-contained Naftiko capability
    covering one Prefect business surface.'
  tags:
  - Prefect
  - Task Runs
  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-runs
    baseUri: ''
    description: Prefect Cloud API — Task Runs business capability. Self-contained, no shared references.
    resources:
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/
      operations:
      - name: createtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunspost
        method: POST
        description: Create Task Run
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-count
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/count
      operations:
      - name: counttaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunscountpost
        method: POST
        description: Count Task Runs
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-filter
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/filter
      operations:
      - name: readtaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunsfilterpost
        method: POST
        description: Read Task Runs
        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: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-history
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/history
      operations:
      - name: taskrunhistoryapiaccountsaccountidworkspacesworkspaceidtaskrunshistorypost
        method: POST
        description: Task Run History
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-paginate
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/paginate
      operations:
      - name: paginatetaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunspaginatepost
        method: POST
        description: Paginate Task Runs
        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: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-id
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/{id}
      operations:
      - name: deletetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsiddelete
        method: DELETE
        description: Delete Task Run
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
      - name: updatetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidpatch
        method: PATCH
        description: Update Task Run
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: readtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidget
        method: GET
        description: Read Task Run
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-id-artifacts
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/{id}/artifacts
      operations:
      - name: gettaskrunartifactsapiaccountsaccountidworkspacesworkspaceidtaskrunsidartifactsget
        method: GET
        description: Get Task Run Artifacts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: depth
          in: query
          type: string
          description: Optional depth limit for recursion (0 = task run only)
        - name: since
          in: query
          type: string
          description: Only return artifacts created on or after this timestamp
        - name: until
          in: query
          type: string
          description: Only return artifacts created on or before this timestamp
        - name: sort
          in: query
          type: string
          description: Sort order by creation time (asc or desc)
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-id-assets-materializat
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/{id}/assets/materializations
      operations:
      - name: gettaskrunmaterializationsapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsmaterializationsget
        method: GET
        description: Get Task Run Materializations
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: depth
          in: query
          type: string
          description: 'Optional depth limit based on execution hierarchy. depth=0: only the task run. depth=1: task run +
            its descendants. None: unlimited depth (default).'
        - name: since
          in: query
          type: string
          description: Only return materializations on or after this timestamp
        - name: until
          in: query
          type: string
          description: Only return materializations on or before this timestamp
        - name: sort
          in: query
          type: string
          description: Sort order by occurred time (asc or desc)
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-id-assets-references
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/{id}/assets/references
      operations:
      - name: gettaskrunreferencesapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsreferencesget
        method: GET
        description: Get Task Run References
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: account_id
          in: path
          type: string
          required: true
        - name: depth
          in: query
          type: string
          description: 'Optional depth limit based on execution hierarchy. depth=0: only the task run. depth=1: task run +
            its descendants. None: unlimited depth (default).'
        - name: since
          in: query
          type: string
          description: Only return references on or after this timestamp
        - name: until
          in: query
          type: string
          description: Only return references on or before this timestamp
        - name: sort
          in: query
          type: string
          description: Sort order by occurred time (asc or desc)
        - name: x-prefect-api-version
          in: header
          type: string
    - name: api-accounts-account_id-workspaces-workspace_id-task_runs-id-set_state
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/task_runs/{id}/set_state
      operations:
      - name: settaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunsidsetstatepost
        method: POST
        description: Set Task Run State
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: id
          in: path
          type: string
          description: The task run id
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-accounts-account_id-workspaces-workspace_id-ui-task_runs-count
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/ui/task_runs/count
      operations:
      - name: readtaskruncountsbystateapiaccountsaccountidworkspacesworkspaceiduitaskrunscountpost
        method: POST
        description: Read Task Run Counts By State
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-accounts-account_id-workspaces-workspace_id-ui-task_runs-dashboard-counts
      path: /api/accounts/{account_id}/workspaces/{workspace_id}/ui/task_runs/dashboard/counts
      operations:
      - name: readdashboardtaskruncountsapiaccountsaccountidworkspacesworkspaceiduitaskrunsdashboardcountspost
        method: POST
        description: Read Dashboard Task Run Counts
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: account_id
          in: path
          type: string
          required: true
        - name: workspace_id
          in: path
          type: string
          required: true
        - name: x-prefect-api-version
          in: header
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
  exposes:
  - type: rest
    namespace: prefect-task-runs-rest
    port: 8080
    description: REST adapter for Prefect Cloud API — Task Runs. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs
      name: api-accounts-account-id-workspaces-workspace-id-task-runs
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs.
      operations:
      - method: POST
        name: createtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunspost
        description: Create Task Run
        call: prefect-task-runs.createtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunspost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/count
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-count
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-count.
      operations:
      - method: POST
        name: counttaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunscountpost
        description: Count Task Runs
        call: prefect-task-runs.counttaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunscountpost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/filter
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-filter
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-filter.
      operations:
      - method: POST
        name: readtaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunsfilterpost
        description: Read Task Runs
        call: prefect-task-runs.readtaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunsfilterpost
        with:
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/history
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-history
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-history.
      operations:
      - method: POST
        name: taskrunhistoryapiaccountsaccountidworkspacesworkspaceidtaskrunshistorypost
        description: Task Run History
        call: prefect-task-runs.taskrunhistoryapiaccountsaccountidworkspacesworkspaceidtaskrunshistorypost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/paginate
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-paginate
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-paginate.
      operations:
      - method: POST
        name: paginatetaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunspaginatepost
        description: Paginate Task Runs
        call: prefect-task-runs.paginatetaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunspaginatepost
        with:
          workspace_id: rest.workspace_id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-id
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-id.
      operations:
      - method: DELETE
        name: deletetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsiddelete
        description: Delete Task Run
        call: prefect-task-runs.deletetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsiddelete
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: updatetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidpatch
        description: Update Task Run
        call: prefect-task-runs.updatetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidpatch
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: readtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidget
        description: Read Task Run
        call: prefect-task-runs.readtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidget
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/artifacts
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-id-artifacts
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-id-artifacts.
      operations:
      - method: GET
        name: gettaskrunartifactsapiaccountsaccountidworkspacesworkspaceidtaskrunsidartifactsget
        description: Get Task Run Artifacts
        call: prefect-task-runs.gettaskrunartifactsapiaccountsaccountidworkspacesworkspaceidtaskrunsidartifactsget
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          depth: rest.depth
          since: rest.since
          until: rest.until
          sort: rest.sort
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/assets/materializations
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-id-assets-materializat
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-id-assets-materializat.
      operations:
      - method: GET
        name: gettaskrunmaterializationsapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsmaterializationsget
        description: Get Task Run Materializations
        call: prefect-task-runs.gettaskrunmaterializationsapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsmaterializationsget
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          depth: rest.depth
          since: rest.since
          until: rest.until
          sort: rest.sort
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/assets/references
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-id-assets-references
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-id-assets-references.
      operations:
      - method: GET
        name: gettaskrunreferencesapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsreferencesget
        description: Get Task Run References
        call: prefect-task-runs.gettaskrunreferencesapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsreferencesget
        with:
          workspace_id: rest.workspace_id
          id: rest.id
          account_id: rest.account_id
          depth: rest.depth
          since: rest.since
          until: rest.until
          sort: rest.sort
          x-prefect-api-version: rest.x-prefect-api-version
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/task-runs/{id}/set-state
      name: api-accounts-account-id-workspaces-workspace-id-task-runs-id-set-state
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-task_runs-id-set_state.
      operations:
      - method: POST
        name: settaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunsidsetstatepost
        description: Set Task Run State
        call: prefect-task-runs.settaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunsidsetstatepost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          id: rest.id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/task-runs/count
      name: api-accounts-account-id-workspaces-workspace-id-ui-task-runs-count
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-ui-task_runs-count.
      operations:
      - method: POST
        name: readtaskruncountsbystateapiaccountsaccountidworkspacesworkspaceiduitaskrunscountpost
        description: Read Task Run Counts By State
        call: prefect-task-runs.readtaskruncountsbystateapiaccountsaccountidworkspacesworkspaceiduitaskrunscountpost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/api/accounts/{account-id}/workspaces/{workspace-id}/ui/task-runs/dashboard/counts
      name: api-accounts-account-id-workspaces-workspace-id-ui-task-runs-dashboard-counts
      description: REST surface for api-accounts-account_id-workspaces-workspace_id-ui-task_runs-dashboard-counts.
      operations:
      - method: POST
        name: readdashboardtaskruncountsapiaccountsaccountidworkspacesworkspaceiduitaskrunsdashboardcountspost
        description: Read Dashboard Task Run Counts
        call: prefect-task-runs.readdashboardtaskruncountsapiaccountsaccountidworkspacesworkspaceiduitaskrunsdashboardcountspost
        with:
          account_id: rest.account_id
          workspace_id: rest.workspace_id
          x-prefect-api-version: rest.x-prefect-api-version
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: prefect-task-runs-mcp
    port: 9090
    transport: http
    description: MCP adapter for Prefect Cloud API — Task Runs. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: create-task-run
      description: Create Task Run
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.createtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunspost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: count-task-runs
      description: Count Task Runs
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.counttaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunscountpost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: read-task-runs
      description: Read Task Runs
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.readtaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunsfilterpost
      with:
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: task-run-history
      description: Task Run History
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.taskrunhistoryapiaccountsaccountidworkspacesworkspaceidtaskrunshistorypost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: paginate-task-runs
      description: Paginate Task Runs
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.paginatetaskrunsapiaccountsaccountidworkspacesworkspaceidtaskrunspaginatepost
      with:
        workspace_id: tools.workspace_id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-task-run
      description: Delete Task Run
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: prefect-task-runs.deletetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsiddelete
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: update-task-run
      description: Update Task Run
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: prefect-task-runs.updatetaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidpatch
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: read-task-run
      description: Read Task Run
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-runs.readtaskrunapiaccountsaccountidworkspacesworkspaceidtaskrunsidget
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: get-task-run-artifacts
      description: Get Task Run Artifacts
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-runs.gettaskrunartifactsapiaccountsaccountidworkspacesworkspaceidtaskrunsidartifactsget
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        depth: tools.depth
        since: tools.since
        until: tools.until
        sort: tools.sort
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: get-task-run-materializations
      description: Get Task Run Materializations
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-runs.gettaskrunmaterializationsapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsmaterializationsget
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        depth: tools.depth
        since: tools.since
        until: tools.until
        sort: tools.sort
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: get-task-run-references
      description: Get Task Run References
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: prefect-task-runs.gettaskrunreferencesapiaccountsaccountidworkspacesworkspaceidtaskrunsidassetsreferencesget
      with:
        workspace_id: tools.workspace_id
        id: tools.id
        account_id: tools.account_id
        depth: tools.depth
        since: tools.since
        until: tools.until
        sort: tools.sort
        x-prefect-api-version: tools.x-prefect-api-version
      outputParameters:
      - type: object
        mapping: $.
    - name: set-task-run-state
      description: Set Task Run State
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: prefect-task-runs.settaskrunstateapiaccountsaccountidworkspacesworkspaceidtaskrunsidsetstatepost
      with:
        account_id: tools.account_id
        workspace_id: tools.workspace_id
        id: tools.id
        x-prefect-api-version: tools.x-prefe

# --- truncated at 32 KB (33 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/prefect/refs/heads/main/capabilities/prefect-task-runs.yaml