# Initiate Classification Run — Utopian Labs

> Initiate a classification run of the R1-Classification agent. See the documentation

- Key: `utopian_labs-initiate-classification-run`
- Type: Action (Write)
- Version: 0.0.2
- App: Utopian Labs (`utopian_labs`) — https://pipedream.com/apps/utopian-labs.md
- This page (HTML): https://pipedream.com/apps/utopian-labs/actions/initiate-classification-run
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/utopian_labs/actions/initiate-classification-run/initiate-classification-run.mjs

## Description

Initiate a classification run of the R1-Classification agent. [See the documentation](https://docs.utopianlabs.ai/classification#initiate-a-classification-run)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `agent` | `string` | Yes | The agent to run |
| `lead` | `object` | Yes | The lead to determine the classification for. See the documentation for more information. Example: { "company": { "website": "https://pipedream.com/" } } |
| `options` | `string[]` | Yes | The options to classify the lead into (minimum 2, maximum 10). Each option should be an object such as: { "name": "option name", "description": "option description" } |
| `minResearchSteps` | `integer` | No | Optionally limit the agent to a minimum amount of research steps (default is 0) |
| `maxResearchSteps` | `integer` | No | Optionally limit the agent to a maximum amount of research steps (default is 5) |
| `context` | `string` | No | The context for the run. This is a free-form string that will be used to guide the agent's research |
| `additionalOptions` | `object` | No | Additional parameters to send in the request. See the documentation for all available parameters. Values will be parsed as JSON where applicable. |

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

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: "utopian_labs-initiate-classification-run",
  arguments: {
    agent: "Agent",
    lead: "Lead",
  },
})
```

**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: "utopian_labs-initiate-classification-run",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    utopian_labs: { authProvisionId: "apn_xxxxxxx" },
    agent: "Agent",
    lead: "Lead",
  },
})

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": "utopian_labs-initiate-classification-run",
    "configured_props": {
      "utopian_labs": { "authProvisionId": "apn_xxxxxxx" },
      "agent": "Agent",
      "lead": "Lead"
    }
  }'
```

---

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