Skip to main content
Glama
el-el-san

AI Video Generator MCP Server

by el-el-san

check-video-status

Monitor the progress of a video generation request by providing the request ID. Track status and ensure completion using AI models like Luma Ray2 or Kling.

Instructions

Check the status of a video generation request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoAI model used for the request (luma=Ray2, kling=Kling)luma
request_idYesThe request ID to check

Implementation Reference

  • Handler for the 'check-video-status' tool. Determines the model, validates it, calls falClient.queue.status with the requestId, processes the response to extract status, logs, and position, and returns a JSON-formatted text content response. Handles errors appropriately.
    } else if (name === "check-video-status") {
      try {
        // Determine which model to use
        const modelName = args.model || "luma";
        const modelUrl = MODELS[modelName as keyof typeof MODELS];
        
        if (!modelUrl) {
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Invalid model: ${modelName}. Supported models are: luma, kling`
              }
            ]
          };
        }
    
        const status: any = await falClient.queue.status(modelUrl, {
          requestId: args.request_id,
          logs: true
        });
        
        // Safely extract properties
        const statusLogs = Array.isArray(status.logs) ? status.logs : [];
        const position = status.position || status.queue_position || 0;
        
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                model: modelName,
                status: status.status,
                logs: statusLogs,
                position: position
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error checking video status: ${error instanceof Error ? error.message : String(error)}`
            }
          ]
        };
      }
  • Registration and schema for 'check-video-status' tool in the ListToolsRequestSchema handler. Defines name, description, and input schema requiring 'request_id' and optional 'model'.
    {
      name: "check-video-status",
      description: "Check the status of a video generation request",
      inputSchema: {
        type: "object",
        properties: {
          request_id: {
            type: "string",
            description: "The request ID to check"
          },
          model: {
            type: "string",
            enum: ["luma", "kling"],
            default: "luma",
            description: "AI model used for the request (luma=Ray2, kling=Kling)"
          }
        },
        required: ["request_id"]
      }
    }
  • src/index.ts:40-116 (registration)
    The ListToolsRequestSchema handler where the 'check-video-status' tool is registered by including it in the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "generate-video",
            description: "Generate a video from text prompt and/or images using AI models (Luma or Kling)",
            inputSchema: {
              type: "object",
              properties: {
                prompt: {
                  type: "string",
                  description: "Text description of the desired video content"
                },
                image_url: {
                  type: "string",
                  description: "Initial image to start the video from (URL or base64 data URI)"
                },
                end_image_url: {
                  type: "string",
                  description: "Final image to end the video with (URL or base64 data URI)"
                },
                aspect_ratio: {
                  type: "string",
                  enum: ["16:9", "9:16", "4:3", "3:4", "21:9", "9:21"],
                  default: "16:9",
                  description: "Aspect ratio of the video"
                },
                resolution: {
                  type: "string",
                  enum: ["540p", "720p", "1080p"],
                  default: "540p",
                  description: "Resolution of the video (higher resolutions use more credits)"
                },
                duration: {
                  type: "string",
                  enum: ["5s", "9s"],
                  default: "5s",
                  description: "Duration of the video (9s costs 2x more)"
                },
                loop: {
                  type: "boolean",
                  default: false,
                  description: "Whether the video should loop (blend end with beginning)"
                },
                model: {
                  type: "string",
                  enum: ["luma", "kling"],
                  default: "luma",
                  description: "AI model to use (luma=Ray2, kling=Kling)"
                }
              },
              required: ["prompt"]
            }
          },
          {
            name: "check-video-status",
            description: "Check the status of a video generation request",
            inputSchema: {
              type: "object",
              properties: {
                request_id: {
                  type: "string",
                  description: "The request ID to check"
                },
                model: {
                  type: "string",
                  enum: ["luma", "kling"],
                  default: "luma",
                  description: "AI model used for the request (luma=Ray2, kling=Kling)"
                }
              },
              required: ["request_id"]
            }
          }
        ]
      };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but reveals nothing about response format, error conditions, rate limits, authentication requirements, or whether this is a read-only operation (though implied by 'check'). For a status-checking tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized and front-loaded with the essential information.

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

Completeness2/5

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

For a status-checking tool with no annotations and no output schema, the description is incomplete. It doesn't explain what status information will be returned, possible states (pending, completed, failed), or how to interpret results. The agent would need to guess about the tool's behavior and output format.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents both parameters. The description doesn't add any parameter semantics beyond what's in the schema (like explaining the relationship between request_id and previous video generation). Baseline 3 is appropriate when the schema does all the parameter documentation work.

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

Purpose4/5

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

The description clearly states the action ('check') and resource ('video generation request'), making the purpose immediately understandable. However, it doesn't differentiate this status-checking tool from its sibling 'generate-video' tool, which would be helpful for an agent choosing between them.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites (like needing a request_id from a previous generation), nor does it explain the relationship with the sibling 'generate-video' tool, leaving the agent to infer usage context.

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

Related 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/el-el-san/fal-mcp-server'

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