# Search and Execute — Strale

> Describe what you need in plain language — Strale picks the best capability and executes it in one step. Use this when you don't know the exact capability slug. If you already know the slug, use Execute Capability instead; if you only want…

- Key: `strale-search-and-execute`
- Type: Action (Write)
- Version: 0.0.2
- App: Strale (`strale`) — https://pipedream.com/apps/strale.md
- This page (HTML): https://pipedream.com/apps/strale/actions/search-and-execute
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/strale/actions/search-and-execute/search-and-execute.mjs

## Description

Describe what you need in plain language — Strale picks the best capability and executes it in one step. Use this when you don't know the exact capability slug. If you already know the slug, use **Execute Capability** instead; if you only want to discover matches without running anything, use **Search Capabilities**. [See the documentation](https://strale.dev/docs)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `task` | `string` | Yes | A natural-language description of what you need (e.g. "verify a Swedish company", "validate this VAT number"). |
| `inputs` | `object` | No | Input parameters for the capability as a JSON object (e.g. { "vat_number": "SE556677889901" } or { "email": "ops@example.com" }). The required fields depend on the capability being called. |
| `maxPriceCents` | `integer` | No | Maximum price in euro cents you are willing to pay per execution. |
| `dryRun` | `boolean` | No | If true, validates the request and returns the matched capability without executing or charging. |

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

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: "strale-search-and-execute",
  arguments: {
    task: "Task",
    inputs: "Inputs",
  },
})
```

**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: "strale-search-and-execute",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    strale: { authProvisionId: "apn_xxxxxxx" },
    task: "Task",
    inputs: "Inputs",
  },
})

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": "strale-search-and-execute",
    "configured_props": {
      "strale": { "authProvisionId": "apn_xxxxxxx" },
      "task": "Task",
      "inputs": "Inputs"
    }
  }'
```

---

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