# List Labels — Linear (API key)

> List issue labels in Linear. Use this to retrieve label IDs and names for filtering or label-management flows. See the documentation.

- Key: `linear_app-list-labels`
- Type: Action (Read-only)
- Version: 0.0.4
- App: Linear (API key) (`linear_app`) — https://pipedream.com/apps/linear-app.md
- This page (HTML): https://pipedream.com/apps/linear-app/actions/list-labels
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/linear_app/actions/list-labels/list-labels.mjs

## Description

List issue labels in Linear. Use this to retrieve label IDs and names for filtering or label-management flows. [See the documentation](https://studio.apollographql.com/public/Linear-API/variant/current/schema/reference/objects/Query?query=issueLabels).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderBy` | `string` | No | By which field should the pagination order by. Available options are createdAt (default) and updatedAt. |
| `first` | `integer` | No | The number of labels to return |
| `after` | `string` | No | Cursor for pagination to fetch the next page (example: "label_01J8XYZABCDEF123456789"). |
| `before` | `string` | No | Cursor for pagination to fetch the previous page (example: "label_01J8XYZABCDEF123456789"). |
| `last` | `integer` | No | The number of items to backward paginate (used with before). Defaults to 50. |
| `includeArchived` | `boolean` | No | Should archived resources be included? (default: false) |
| `filter` | `object` | No | Filter returned issue labels. See the documentation for more details. Example: { "name": { "contains": "Bug" } } |

## 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": "linear_app",
      },
    },
  },
)

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: "linear_app-list-labels",
  arguments: {
    orderBy: "Order By",
    first: 10,
  },
})
```

**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: "linear_app-list-labels",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    linear_app: { authProvisionId: "apn_xxxxxxx" },
    orderBy: "Order By",
    first: 10,
  },
})

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": "linear_app-list-labels",
    "configured_props": {
      "linear_app": { "authProvisionId": "apn_xxxxxxx" },
      "orderBy": "Order By",
      "first": 10
    }
  }'
```

---

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