Request External Resource
request_external_resourceRequest the USER'S OWN external credential for this project — their OpenAI or Anthropic API key, an external Postgres connection string, or any other service's key (type GENERIC, e.g. Stripe/Resend — name the env vars via secret_env_vars; a var the user can only produce LATER, like a webhook signing secret, goes in optional_env_vars so the dialog doesn't demand it up front). NOT for Floot-managed resources (database/auth/push/oauth/…) — use provision_resource for those; they need no user input. REUSE FIRST: if the project owner already has a matching credential on their account (list_resources section 2), this connects it silently and returns the env var names — no link, no user action, nothing to poll. Pass the name exactly as list_resources shows it to make that happen. Reusing a POSTGRES credential also seeds helpers/db, installs the query stack, and pulls the typed schema helper, so do NOT write those yourself afterwards. Otherwise it returns a secure connect link: SHOW it to the user (UI-capable hosts render a Connect button automatically; on terminal hosts with shell access open it in the user's default browser yourself and paste the URL as plain text) and ask them to open it. The call completes only when the user finishes the connect flow — it never expires. Do NOT block on it: request the credential EARLY, keep building everything that doesn't need the secret (the env var names are known now — reference process.env.X in code before the secret exists), and check the request between tasks; the user may never connect it, and the build must not stall. NEVER ask the user to paste a secret into the chat. On completion you get the env var names — never the secret values. Re-calling with the same type returns the same pending request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Display name for GENERIC requests, e.g. 'Stripe'. | |
| type | Yes | ||
| projectId | Yes | ||
| instructions | No | Why the key is needed / where the user can find it — shown to the user in the dialog. | |
| secret_env_vars | No | GENERIC only: the env var name(s) the secret(s) should be exposed as (default RESOURCE_API_KEY). Every var listed here is a REQUIRED field in the connect dialog — the user cannot submit while one is blank, so only list vars the user can produce right now; anything they'd fill in later belongs in optional_env_vars instead. | |
| optional_env_vars | No | GENERIC only: env vars the user may leave blank at connect time and fill in later — e.g. a webhook signing secret that only exists after the webhook endpoint is created. Rendered as optional fields; names here need not repeat secret_env_vars (a name in both stays required). To collect a skipped value later, call request_external_resource again — the connected resource opens in an update dialog. |