# Search Things — Bubble

> Searches for things (records) in your Bubble app's database with optional filtering, sorting, and pagination. See the documentation

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

## Description

Searches for things (records) in your Bubble app's database with optional filtering, sorting, and pagination. [See the documentation](https://manual.bubble.io/core-resources/api/the-bubble-api/the-data-api/data-api-requests#get-a-list-of-things)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `typeName` | `string` | Yes | The name of the data type (e.g., customer, product). The API will convert this to lowercase with spaces removed. |
| `constraints` | `string[]` | No | Array of search filters as JSON strings. Each constraint should be a JSON object with key, constraint_type, and value properties. Example: {"key": "name", "constraint_type": "equals", "value": "John"}. Supported constraint types: equals, not equal, is_empty, is_not_empty, text contains, not text contains, greater than, less than, in, not in, contains, not contains, geographic_search. |
| `cursor` | `integer` | No | Starting position for pagination (rank of first item to return) |
| `limit` | `integer` | No | Maximum number of items to return (up to 50,000 for standard plans, 10,000,000 for Enterprise) |
| `sortField` | `string` | No | Field name to sort results by (defaults to creation date) |
| `descending` | `boolean` | No | Set to true to sort in descending order, false for ascending |

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

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: "bubble-search-things",
  arguments: {
    typeName: "Data Type Name",
    constraints: ["Constraints"],
  },
})
```

**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: "bubble-search-things",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bubble: { authProvisionId: "apn_xxxxxxx" },
    typeName: "Data Type Name",
    constraints: ["Constraints"],
  },
})

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": "bubble-search-things",
    "configured_props": {
      "bubble": { "authProvisionId": "apn_xxxxxxx" },
      "typeName": "Data Type Name",
      "constraints": ["Constraints"]
    }
  }'
```

---

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