fal-get-result
Retrieve the output of a completed model run, automatically converting any image URLs in the response to embedded base64 data. Use after checking execution status with the status tool.
Instructions
Get the result of a model execution and automatically download any image URLs in the response. Returns the model output with embedded base64 image data for any image URLs found. You need to check the status of the model using the fal-get-status tool first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | ||
| modelId | Yes |
Implementation Reference
- src/tools/index.ts:106-114 (registration)Registration of the 'fal-get-result' tool using server.tool(). Defines the name, description, schema (requestId and modelId strings), and handler that delegates to client.getResult().
server.tool( 'fal-get-result', 'Get the result of a model execution and automatically download any image URLs in the response. Returns the model output with embedded base64 image data for any image URLs found. You need to check the status of the model using the fal-get-status tool first.', { requestId: z.string(), modelId: z.string() }, async ({ requestId, modelId }) => { const output = await client.getResult(requestId, modelId); return { content: [{ type: 'text', text: toText(output) }] }; }, ); - src/tools/index.ts:110-113 (handler)The handler function for 'fal-get-result'. Calls client.getResult(requestId, modelId) and returns the output as text content.
async ({ requestId, modelId }) => { const output = await client.getResult(requestId, modelId); return { content: [{ type: 'text', text: toText(output) }] }; }, - src/tools/index.ts:109-109 (schema)Input schema definition for 'fal-get-result' tool: { requestId: z.string(), modelId: z.string() } using Zod validation.
{ requestId: z.string(), modelId: z.string() }, - src/services/fal-client.ts:73-78 (helper)The getResult() method on FalClient that performs the actual HTTP GET request to the queue endpoint baseModel/requests/requestId.
async getResult(requestId: string, modelId: string): Promise<unknown> { const baseModel = this._baseModelId(this._normalizeModelId(modelId)); const url = `${this.QUEUE_BASE}/${baseModel}/requests/${encodeURIComponent(requestId)}`; const output = await this._getJson(url); return output; }