# List Workbooks — Tableau

> Returns a list of the workbooks on the specified site. See the documentation

- Key: `tableau-list-workbooks`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Tableau (`tableau`) — https://pipedream.com/apps/tableau.md
- This page (HTML): https://pipedream.com/apps/tableau/actions/list-workbooks
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/tableau/actions/list-workbooks/list-workbooks.mjs

## Description

Returns a list of the workbooks on the specified site. [See the documentation](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm#query_workbooks_for_site)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `siteId` | `string` | Yes | The ID of the site to list workbooks for. Can use the List Sites action to get a list of sites. Options are loaded from the connected account. |
| `filter` | `string` | No | An expression that lets you specify a subset of workbooks to return. You can filter on predefined fields such as name, tags, and createdAt. You can include multiple filter expressions. For more information, see Filtering and Sorting. |
| `sort` | `string` | No | An expression that lets you specify the order in which workbook information is returned. If you do not specify a sort expression, the sort order of the information that's returned is undefined. For more information, see Filtering and Sorting. |
| `field` | `string` | No | An expression that lets you specify the set of available fields to return. You can qualify the return values based upon predefined keywords such as all or default, and you can specify individual fields for the workbooks or other supported resources. You can include multiple field expressions in a request. For more information, see Using Fields in the REST API. |
| `pageSize` | `integer` | No | The number of workbooks to return per page. The default is 100. Maximum is 1000. |
| `pageNumber` | `integer` | No | The page number to return. The default is 1. |

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

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: "tableau-list-workbooks",
  arguments: {
    siteId: "Site ID",
    filter: "Filter",
  },
})
```

**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: "tableau-list-workbooks",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    tableau: { authProvisionId: "apn_xxxxxxx" },
    siteId: "Site ID",
    filter: "Filter",
  },
})

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": "tableau-list-workbooks",
    "configured_props": {
      "tableau": { "authProvisionId": "apn_xxxxxxx" },
      "siteId": "Site ID",
      "filter": "Filter"
    }
  }'
```

---

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