# List Workspace Projects — Toggl Track

> List the projects in a Toggl Track workspace, optionally filtered by active status or a name fragment. Use it to find a project ID before calling List Project Tasks or Get Project Task Time Summary, or to answer "what projects do we have"…

- Key: `toggl-list-workspace-projects`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Toggl Track (`toggl`) — https://pipedream.com/apps/toggl.md
- This page (HTML): https://pipedream.com/apps/toggl/actions/list-workspace-projects
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/toggl/actions/list-workspace-projects/list-workspace-projects.mjs

## Description

List the projects in a Toggl Track workspace, optionally filtered by active status or a name fragment. Use it to find a project ID before calling **List Project Tasks** or **Get Project Task Time Summary**, or to answer "what projects do we have". To find a workspace ID, use **List Workspace ID Options**; this action does not return time entries or tracked hours (use **Get Time Entry Summary** or **Search Detailed Time Entries** with a project filter for those). Returns at most 1000 projects, each with `id` plus the selected fields (default: name, client_id, active, billable, color, start_date, end_date, created_at). Example: workspaceId=1234567, name="Website", active="true" → matching projects with id, name, client_id, active, billable. [See the documentation](https://engineering.toggl.com/docs/api/projects/#get-workspaceprojects)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `workspaceId` | `integer` | Yes | The Toggl Track workspace ID, e.g. 1234567. Use List Workspace ID Options to find it (the value field). |
| `active` | `string` | Yes | Which projects to list: true for active projects only, false for archived projects only, both for all, e.g. true. |
| `name` | `string` | No | Optional case-insensitive name fragment to filter projects by, e.g. Website. |
| `fields` | `string[]` | Yes | Project fields to return besides id, e.g. ["name", "client_id"]. Defaults to name, client_id, active, billable, color, start_date, end_date and created_at. Select All Fields for the complete rows. |

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

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: "toggl-list-workspace-projects",
  arguments: {
    workspaceId: 10,
    active: "Active",
  },
})
```

**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: "toggl-list-workspace-projects",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    toggl: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: 10,
    active: "Active",
  },
})

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": "toggl-list-workspace-projects",
    "configured_props": {
      "toggl": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": 10,
      "active": "Active"
    }
  }'
```

---

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