# Find Controls — Drata

> Find Controls. See the documentation.

- Key: `drata-find-controls`
- Type: Action (Read-only)
- Version: 0.0.4
- App: Drata (`drata`) — https://pipedream.com/apps/drata.md
- This page (HTML): https://pipedream.com/apps/drata/actions/find-controls
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/drata/actions/find-controls/find-controls.mjs

## Description

Find Controls. [See the documentation](https://developers.drata.com/docs/openapi/reference/operation/GRCPublicController_getControls/).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `q` | `string` | No | Query to search for |
| `frameworkTags` | `string[]` | No | Filter data by controls associated with these framework tags |
| `frameworkSlug` | `string` | No | Filter data by controls associated with these custom framework Slug |
| `trustServiceCriteria` | `string[]` | No | Filter controls on their Trust Service Criteria |
| `ismsCategory` | `string[]` | No | Filter controls on their ISMS Category |
| `isms2022Category` | `string[]` | No | Filter controls on their ISMS Category |
| `isAnnexA2022` | `boolean` | No | Filter controls on if they are an Annex A requirement |
| `rules` | `string[]` | No | Filter controls on their Hipaa rules |
| `subRules` | `string[]` | No | Filter controls on their Hipaa sub rules |
| `pciRequirements` | `string[]` | No | Filter controls on their PCI requirements |
| `chapters` | `string[]` | No | Filter controls on their GDPR chapters |
| `statutes` | `string[]` | No | Filter controls on their CCPA statutes |
| `regulations` | `string[]` | No | Filter controls on their CCPA regulations |
| `functions` | `string[]` | No | Filter controls on their NIST CSF Functions |
| `sections` | `string[]` | No | Filter controls on their MSSSPA Section |
| `controlFamilies` | `string[]` | No | Filter controls on their NIST SP 800-171 Control Family |
| `controlClasses` | `string[]` | No | Filter controls on their NIST SP 800-171 Control Class |
| `iso27701` | `string[]` | No | Filter controls on their ISO27701 requirements |
| `cobit` | `string[]` | No | Filter controls on their COBIT requirements |
| `soxitgc` | `string[]` | No | Filter controls on their SOX requirements |
| `controlBaselines` | `string[]` | No | Filter controls on their NIST SP 800-53 Control Baseline |
| `cmmcClasses` | `string[]` | No | Filter controls on their NIST SP 800-53 Control Baseline |
| `domains` | `string[]` | No | Filter controls on their FFIEC Domains |
| `assessmentFactors` | `string[]` | No | Filter controls on their FFIEC Assessment Factors |
| `userIds` | `integer[]` | No | User Ids of Control Owners |
| `isOwned` | `boolean` | No | Filter controls on if they have a control owner |
| `isReady` | `boolean` | No | Filter controls on if they are ready |
| `isAnnexA` | `boolean` | No | Filter controls on if they are an Annex A requirement |
| `isArchived` | `boolean` | No | Filter to controls that are or are not archived |
| `isMonitored` | `boolean` | No | Filter to controls that are or are not monitored |
| `hasEvidence` | `boolean` | No | Filter to controls with or without evidence |
| `hasPassingTest` | `boolean` | No | Filter to controls with at least one passing test |
| `excludeIds` | `integer[]` | No | Exclude controls by array of id |
| `excludeRequirementId` | `integer` | No | Exclude controls if they are mapped to this requirement id |
| `requirementId` | `integer` | No | Only include controls if they are mapped to this requirement id |
| `excludeTestId` | `integer` | No | Exclude controls if they are mapped to this test id |
| `testId` | `integer` | No | Only include controls if they are mapped to this test id |
| `hasTicket` | `string` | No | Only include controls if they associted to a task management ticket |
| `connectionId` | `integer` | No | This will be filled in automatic when using a taskManagementStatus. |

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

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: "drata-find-controls",
  arguments: {
    q: "Query",
    frameworkTags: ["Framework Tags"],
  },
})
```

**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: "drata-find-controls",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    drata: { authProvisionId: "apn_xxxxxxx" },
    q: "Query",
    frameworkTags: ["Framework Tags"],
  },
})

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": "drata-find-controls",
    "configured_props": {
      "drata": { "authProvisionId": "apn_xxxxxxx" },
      "q": "Query",
      "frameworkTags": ["Framework Tags"]
    }
  }'
```

---

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