fal.ai MCP by usefulapi

v1.41.1
io.usefulapi/falai Checked 3 days ago Published 1 day ago

Run fal.ai models, poll the inference queue and read model schemas.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

falai_list_models List models

List or search fal.ai models in the registry (paginated). fal.ai API: GET /models (query: keywords, page, total).

ParameterTypeDescription
keywordsstringOptional search string to filter models by.
pageinteger1-based page number (default 1).
totalintegerPage size (number of models per page).

falai_get_model_schema Get model schema

Get the OpenAPI 3 schema for a model — its input/output fields (components.schemas). Use this to learn what inputs a model accepts before submitting. fal.ai API: GET /openapi/queue/openapi.json?endpoint_id={model_id}.

ParameterTypeDescription
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.

falai_get_request_status Get request status

Get the status of a queued request (IN_QUEUE | IN_PROGRESS | COMPLETED). fal.ai queue: GET {queue}/{model_id}/requests/{request_id}/status (optional logs=1).

ParameterTypeDescription
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.
request_id *stringThe queue request id returned when the request was submitted.
logsbooleanInclude queue logs in the response (?logs=1).

falai_get_request_result Get request result

Get the final output of a COMPLETED queued request. fal.ai queue: GET {queue}/{model_id}/requests/{request_id}.

ParameterTypeDescription
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.
request_id *stringThe queue request id returned when the request was submitted.

falai_submit_request Submit request

Submit an inference request to the queue and return immediately (async — does NOT wait for completion). Returns { request_id, response_url, status_url, cancel_url, queue_position }. Consumes fal credits when the model runs. fal.ai queue: POST {queue}/{model_id} with body = the model input.

ParameterTypeDescription
input *objectThe model's input object — arbitrary params for that model, e.g. { "prompt": "a cat" }. Use falai_get_model_schema to learn the fields.
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.

falai_run_model Run model (subscribe)

Convenience 'subscribe': submit a request, poll its status until COMPLETED, then return the result. Consumes fal credits. If it does not complete within the wait budget, returns a { status, request_id, status_url, note } object (NOT an error) so you can keep polling with falai_get_request_status / falai_get_request_result.

ParameterTypeDescription
input *objectThe model's input object — arbitrary params for that model, e.g. { "prompt": "a cat" }. Use falai_get_model_schema to learn the fields.
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.
max_wait_secondsintegerMax seconds to wait for completion (default 60, capped at 300).
poll_interval_secondsintegerSeconds between status polls (default 3, min 1).

falai_cancel_request Cancel request

Request cancellation of a queued (not-yet-started) request. Returns 202 { status: 'CANCELLATION_REQUESTED' }. fal.ai queue: PUT {queue}/{model_id}/requests/{request_id}/cancel.

ParameterTypeDescription
model_id *stringThe fal.ai model id, used raw as a path segment, e.g. 'fal-ai/flux/schnell'.
request_id *stringThe queue request id returned when the request was submitted.