fal-enqueue
Queue a model for processing with required inputs. Monitor progress with fal-get-status and fetch output with fal-get-result.
Instructions
Enqueue a model. The model is enqueued using the fal.run endpoint. You need to check the status of the model using the fal-get-status tool, then get the result using the fal-get-result tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelId | Yes | ||
| input | No |
Implementation Reference
- src/tools/index.ts:88-93 (handler)The tool handler function for 'fal-enqueue'. It extracts modelId and input from args, then calls client.enqueue().
async (args) => { const modelId = (args as any)?.modelId ?? (args as any)?.arguments?.modelId; const input = (args as any)?.input ?? (args as any)?.arguments?.input; const output = await client.enqueue(modelId as any, input); return { content: [{ type: 'text', text: toText(output) }] }; }, - src/services/fal-client.ts:61-65 (helper)The enqueue() method on FalClient that sends a POST request to the queue endpoint (queue.fal.run).
async enqueue(modelId: string, body: unknown): Promise<unknown> { const endpointId = this._normalizeModelId(modelId); const url = `${this.QUEUE_BASE}/${endpointId}`; return await this._postJson(url, body); } - src/tools/index.ts:81-94 (registration)Registration of the 'fal-enqueue' tool via server.tool(), including its Zod schema (modelId: z.string(), input: z.unknown()) and description.
server.tool( 'fal-enqueue', 'Enqueue a model. The model is enqueued using the fal.run endpoint. You need to check the status of the model using the fal-get-status tool, then get the result using the fal-get-result tool.', { modelId: z.string(), input: z.unknown(), }, async (args) => { const modelId = (args as any)?.modelId ?? (args as any)?.arguments?.modelId; const input = (args as any)?.input ?? (args as any)?.arguments?.input; const output = await client.enqueue(modelId as any, input); return { content: [{ type: 'text', text: toText(output) }] }; }, ); - src/tools/index.ts:84-87 (schema)Input schema for the fal-enqueue tool: modelId (string) and input (unknown).
{ modelId: z.string(), input: z.unknown(), },