# Get Request Response — fal.ai

> Gets the response of a completed request in the queue. This retrieves the results of your asynchronous task. See the documentation.

- Key: `fal_ai-get-request-response`
- Type: Action (Read-only)
- Version: 1.0.1
- App: fal.ai (`fal_ai`) — https://pipedream.com/apps/fal-ai.md
- This page (HTML): https://pipedream.com/apps/fal-ai/actions/get-request-response
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/fal_ai/actions/get-request-response/get-request-response.mjs

## Description

Gets the response of a completed request in the queue. This retrieves the results of your asynchronous task. [See the documentation](https://fal.ai/docs/model-endpoints/queue#queue-endpoints).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `appId` | `string` | Yes | The full canonical ID of the model to call, including the owner namespace. E.g. fal-ai/flux/schnell, rundiffusion-fal/juggernaut-flux/base, or your-username/your-app. As a shorthand, a bare single-word name (e.g. lora) is accepted and assumed to be in the fal-ai namespace. |
| `requestId` | `string` | Yes | The unique identifier for the request. |

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

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: "fal_ai-get-request-response",
  arguments: {
    appId: "App ID",
    requestId: "Request ID",
  },
})
```

**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: "fal_ai-get-request-response",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    fal_ai: { authProvisionId: "apn_xxxxxxx" },
    appId: "App ID",
    requestId: "Request ID",
  },
})

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": "fal_ai-get-request-response",
    "configured_props": {
      "fal_ai": { "authProvisionId": "apn_xxxxxxx" },
      "appId": "App ID",
      "requestId": "Request ID"
    }
  }'
```

---

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