# Get Tasks — ClickUp

> Get a list of tasks. See the documentation in Tasks / Get Tasks section.

- Key: `clickup-get-tasks`
- Type: Action (Read-only)
- Version: 0.0.13
- App: ClickUp (`clickup`) — https://pipedream.com/apps/clickup.md
- This page (HTML): https://pipedream.com/apps/clickup/actions/get-tasks
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/clickup/actions/get-tasks/get-tasks.mjs

## Description

Get a list of tasks. [See the documentation](https://clickup.com/api) in **Tasks / Get Tasks** section.

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `string` | Yes | The id of a workspace Options are loaded from the connected account. |
| `spaceId` | `string` | Yes | If selected, the Lists will be filtered by this Space ID Options are loaded from the connected account. |
| `archived` | `boolean` | No | Filter for archived tasks |
| `page` | `integer` | No | The page number to be returned |
| `orderBy` | `string` | No | Order to return tasks |
| `assignees` | `string[]` | No | Select the assignees Options are loaded from the connected account. |
| `folderId` | `string` | No | The ID of a folder Options are loaded from the connected account. |
| `listId` | `string` | Yes | The ID of a list. To show lists within a folder, please select a Folder first Options are loaded from the connected account. |
| `statuses` | `string[]` | No | Filter tasks by one or more statuses Options are loaded from the connected account. |
| `includeMarkdownDescription` | `boolean` | No | Return task descriptions in Markdown format |
| `subtasks` | `boolean` | No | Include subtasks in the response |
| `includeClosed` | `boolean` | No | Include tasks with a Closed status. By default, closed tasks are not returned |
| `includeTiml` | `boolean` | No | Include tasks that exist in multiple lists |
| `watchers` | `string[]` | No | Filter tasks by watchers Options are loaded from the connected account. |
| `tags` | `string[]` | No | Select the tags Options are loaded from the connected account. |
| `dueDateGt` | `integer` | No | Filter tasks with a due date greater than the Unix timestamp (in milliseconds) provided |
| `dueDateLt` | `integer` | No | Filter tasks with a due date less than the Unix timestamp (in milliseconds) provided |
| `dateCreatedGt` | `integer` | No | Filter tasks created after the Unix timestamp (in milliseconds) provided |
| `dateCreatedLt` | `integer` | No | Filter tasks created before the Unix timestamp (in milliseconds) provided |
| `dateUpdatedGt` | `integer` | No | Filter tasks updated after the Unix timestamp (in milliseconds) provided |
| `dateDoneGt` | `integer` | No | Filter tasks completed after the Unix timestamp (in milliseconds) provided |
| `dateDoneLt` | `integer` | No | Filter tasks completed before the Unix timestamp (in milliseconds) provided |
| `customItems` | `string[]` | No | Filter by custom task types. Use 0 for Tasks and 1 for Milestones |
| `customFields` | `string[]` | No | Filter tasks by custom field values. Use the Get Custom Fields action to retrieve valid field_id values for your list. Provide a JSON array of filter objects, e.g. [{"field_id": "abc", "operator": "=", "value": "foo"}] |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "clickup",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "clickup-get-tasks",
  arguments: {
    workspaceId: "Workspace",
    spaceId: "Space",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "clickup-get-tasks",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    clickup: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: "Workspace",
    spaceId: "Space",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "clickup-get-tasks",
    "configured_props": {
      "clickup": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": "Workspace",
      "spaceId": "Space"
    }
  }'
```

---

- App: https://pipedream.com/apps/clickup.md · All apps: https://pipedream.com/apps
