# Search Pipeline Items — Less Annoying CRM

> Lists pipeline items (leads, deals, etc.) in one Less Annoying CRM pipeline, optionally filtered by status or owner. Each item includes its status, the attached contact, last note, and timestamps. Use List Pipelines first to get pipelineId…

- Key: `less_annoying_crm-search-pipeline-items`
- Type: Action (Read-only)
- Version: 0.0.1
- App: Less Annoying CRM (`less_annoying_crm`) — https://pipedream.com/apps/less-annoying-crm.md
- This page (HTML): https://pipedream.com/apps/less-annoying-crm/actions/search-pipeline-items
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/less_annoying_crm/actions/search-pipeline-items/search-pipeline-items.mjs

## Description

Lists pipeline items (leads, deals, etc.) in one Less Annoying CRM pipeline, optionally filtered by status or owner. Each item includes its status, the attached contact, last note, and timestamps. Use **List Pipelines** first to get `pipelineId` and `statusIds` (e.g. the "Leads" pipeline and its "Open" status). For "my leads", get the user ID from **List Users** and pass it in `userIds`. To find leads for one specific contact, use **Get Contact Activities** with `include: ["pipelineItems"]` instead. `advancedFilters` is an optional JSON array of `{"Name", "Operation", "Value"}` objects; see the [filter docs](https://account.lessannoyingcrm.com/api_docs/v2/Advanced/Filter_Pipelines). Returns `results` plus `hasMoreResults`; if true, call again with `page` incremented. Example: `pipelineId: "1234567890123456789012345678904", statusIds: ["1234567890123456789012345678905"]` returns `{"hasMoreResults": false, "results": [{"PipelineItemId": "1234567890123456789012345678903", "StatusId": "1234567890123456789012345678905", "ContactId": "1234567890123456789012345678901", "LastNote": "Inbound website inquiry", "ContactMetaData": {"Name": "Jane Smith"}, ...}]}`. [See the documentation](https://account.lessannoyingcrm.com/api_docs/v2/Core_Functions/Pipeline_Items#Goto-GetPipelineItems)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `pipelineId` | `string` | Yes | The ID of a pipeline (a long numeric string, e.g. 4135054762542398391286410820684). Use List Pipelines to discover pipeline IDs and their statuses. |
| `statusIds` | `string[]` | No | Only return items in these statuses, e.g. ["1234567890123456789012345678905"]. Omit to return items in all active statuses. Use List Pipelines to find status IDs (the StatusId field of each entry in Statuses). |
| `userIds` | `string[]` | No | Only return items whose contact is assigned to these user IDs, e.g. ["1240220"]. Use List Users to find IDs (the UserId field). |
| `advancedFilters` | `string` | No | JSON array of filters, e.g. [{"Name": "DateCreated", "Operation": "GreaterThan", "Value": "2025-01-01"}]. |
| `sortBy` | `string` | No | Field to sort items by, e.g. DateCreated. Defaults to Status. |
| `sortDirection` | `string` | No | Sort order, e.g. Descending. Defaults to Ascending. |
| `maxResults` | `integer` | No | Maximum number of results to return per call (e.g. 50; default 50, max 10000). |
| `page` | `integer` | No | Page of results to return, starting at 1, e.g. 2. Increment while the response has hasMoreResults: true. |

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

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: "less_annoying_crm-search-pipeline-items",
  arguments: {
    pipelineId: "Pipeline ID",
    statusIds: ["Status IDs"],
  },
})
```

**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: "less_annoying_crm-search-pipeline-items",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    less_annoying_crm: { authProvisionId: "apn_xxxxxxx" },
    pipelineId: "Pipeline ID",
    statusIds: ["Status IDs"],
  },
})

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": "less_annoying_crm-search-pipeline-items",
    "configured_props": {
      "less_annoying_crm": { "authProvisionId": "apn_xxxxxxx" },
      "pipelineId": "Pipeline ID",
      "statusIds": ["Status IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/less-annoying-crm.md · All apps: https://pipedream.com/apps
