Skip to main content
Glama

Run fal.ai Model (Synchronous)

fal_run_model

Run a fal.ai model synchronously and receive the result. Ideal for fast models like image generation, image editing, and short text or audio tasks.

Instructions

Run a fal.ai model and block until the result is ready. Best for fast models (a few seconds up to ~2 minutes) like most image generation, image editing, and short text/audio models.

This does NOT use the queue — there is no request_id to check later. For slow models (video generation, training jobs) or when you want to fire off a job and check back later, use fal_submit_request instead.

Args:

  • model_id (string): The fal.ai model id, e.g. "fal-ai/flux/dev"

  • arguments (object): Model-specific input, e.g. { "prompt": "a cat astronaut" }

  • response_format ('markdown' | 'json'): Output format (default: markdown)

Returns: The model's result payload (structure is model-specific — images/video/audio/text). For JSON format: the complete raw result object. For markdown format: a summary with any generated media URLs surfaced up top.

Examples:

  • Use when: "Generate an image of a sunset" -> model_id="fal-ai/flux/dev", arguments={"prompt": "a sunset over mountains"}

  • Use when: "Edit this image to add snow" -> model_id="fal-ai/flux-pro/kontext", arguments={"prompt": "add snow", "image_url": "https://..."}

  • Don't use when: the model is slow (video, training) — use fal_submit_request instead

  • Don't use when: you don't know the model's required fields — call fal_get_model_schema first

Error Handling:

  • Returns "Authentication failed" if FAL_KEY is missing or invalid

  • Returns "Invalid input (422)" if arguments don't match the model's schema — check fal_get_model_schema

  • Returns "Request timed out" if the model takes longer than 5 minutes — use fal_submit_request instead

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idYesThe fal.ai model/endpoint id, e.g. "fal-ai/flux/dev", "fal-ai/flux-pro/kontext", or "fal-ai/minimax/video-01". Find valid ids with fal_list_models or at https://fal.ai/models.
argumentsYesThe model's input arguments as a JSON object, matching that model's own schema (e.g. { "prompt": "a cat astronaut", "image_size": "square_hd" }). Call fal_get_model_schema first if you're unsure what fields a model accepts.
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readable (default: markdown)markdown
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses blocking behavior, absence of queue, timeout of 5 minutes, and error handling outcomes. No contradiction with annotations (readOnlyHint=false, destructiveHint=false).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (main description, Args, Returns, Examples, Error Handling). Slightly lengthy but each section provides necessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all three parameters, return value (model-specific), examples, error conditions, and directs users to related tools. Adequate given no output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds examples for model_id and arguments, explains response_format options, and provides context beyond schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs a fal.ai model synchronously and blocks for the result. It specifies the verb 'Run' and the resource 'fal.ai model', and distinguishes from the asynchronous alternative fal_submit_request.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use (fast models) and when not to (slow models), provides examples, and directs users to fal_submit_request for long-running jobs and fal_get_model_schema for unknown model fields.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MalcolmXavier7/fal-mpc'

If you have feedback or need assistance with the MCP directory API, please join our Discord server