# Get Project Task Time Summary — Toggl Track

> Get how much time was tracked on each task of one Toggl Track project over a date range, with task names, plus the time tracked on the project without a task. Use it when a user asks how much time each task of a project took, e.g. "how…

- Key: `toggl-get-project-task-time-summary`
- 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/get-project-task-time-summary
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/toggl/actions/get-project-task-time-summary/get-project-task-time-summary.mjs

## Description

Get how much time was tracked on each task of one Toggl Track project over a date range, with task names, plus the time tracked on the project without a task. Use it when a user asks how much time each task of a project took, e.g. "how long did each task on Website Redesign take last week?". Use **List Workspace Projects** first to get the project ID. For per-user or per-project totals use **Get Time Entry Summary**, and for the individual time entries use **Search Detailed Time Entries**; both accept a project filter. A date range is required: either a Date Preset (resolved in the connected user's Toggl timezone and first day of week) or both Start Date and End Date. Returns `dateRange`, `totalSeconds`, `tasks` (each with `taskId`, `taskName` and `seconds`, most time first) and `untaskedSeconds`. Example: workspaceId=1234567, projectId=123456789, datePreset="last_week" → each task's tracked seconds for last week. [See the documentation](https://engineering.toggl.com/docs/track/reports/summary_reports/)

## 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). |
| `projectId` | `integer` | Yes | The Toggl Track project ID, e.g. 123456789. Use List Workspace Projects to find it (the id field). The project must belong to the given workspace. |
| `datePreset` | `string` | No | Optional report range resolved using the connected user's Toggl timezone and first day of week, e.g. last_month. For all-user reports, Toggl evaluates dates in each time entry creator's profile timezone. |
| `startDate` | `string` | No | Inclusive report start date in YYYY-MM-DD format, e.g. 2026-09-01. Required with End Date when Date Preset is not used. |
| `endDate` | `string` | No | Inclusive report end date in YYYY-MM-DD format, e.g. 2026-09-30. It may be the same as Start Date. |

## 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-get-project-task-time-summary",
  arguments: {
    workspaceId: 10,
    projectId: 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: "toggl-get-project-task-time-summary",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    toggl: { authProvisionId: "apn_xxxxxxx" },
    workspaceId: 10,
    projectId: 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": "toggl-get-project-task-time-summary",
    "configured_props": {
      "toggl": { "authProvisionId": "apn_xxxxxxx" },
      "workspaceId": 10,
      "projectId": 10
    }
  }'
```

---

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