# List Locations — Google Business Profile

> Lists the locations for the specified account. See the documentation

- Key: `google_my_business-list-locations`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Google Business Profile (`google_my_business`) — https://pipedream.com/apps/google-my-business.md
- This page (HTML): https://pipedream.com/apps/google-my-business/actions/list-locations
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_my_business/actions/list-locations/list-locations.ts

## Description

Lists the locations for the specified account. [See the documentation](https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `account` | `string` | Yes | Select an Account or provide a custom Account Name. Options are loaded from the connected account. |
| `readMask` | `string` | No | A comma-separated list of fields to return for each location (e.g. name,title,categories,storefrontAddress). Defaults to name,title if omitted. |
| `filter` | `string` | No | A filter constraining the locations to return. See the documentation for supported filter syntax. |
| `orderBy` | `string` | No | Sorting order for the request. Multiple fields should be comma-separated, following SQL syntax. The default sorting order is ascending. To specify descending order, a suffix " desc" should be added. Valid fields to orderBy are title and storeCode. For example: "title, storeCode desc" or "title" or "storeCode desc" |
| `pageSize` | `integer` | No | Number of locations to return per page. |
| `pageToken` | `string` | No | Token from a previous response to retrieve the next page of results. |

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

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: "google_my_business-list-locations",
  arguments: {
    account: "Account Name",
    readMask: "Read Mask",
  },
})
```

**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: "google_my_business-list-locations",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_my_business: { authProvisionId: "apn_xxxxxxx" },
    account: "Account Name",
    readMask: "Read Mask",
  },
})

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": "google_my_business-list-locations",
    "configured_props": {
      "google_my_business": { "authProvisionId": "apn_xxxxxxx" },
      "account": "Account Name",
      "readMask": "Read Mask"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-my-business.md · All apps: https://pipedream.com/apps
