Skip to main content
Glama
stabgan

OpenRouter MCP Multimodal Server

get_video_status

Read-onlyIdempotent

Check the status of a video generation job by its ID. If completed, download the video optionally saving it to a specified path.

Instructions

Resume a previously submitted video generation job by id. Returns the latest status; if completed, downloads the video (and saves it when save_path is provided).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYesJob id from a previous generate_video call.
save_pathNoOptional save path (applies when the job is already completed).

Implementation Reference

  • The main handler function that executes the get_video_status tool logic. It takes a GetVideoStatusToolRequest, validates video_id, optionally resolves save_path, polls the video job status via apiClient.pollVideoJob(), and returns the result (completed, failed, or still running).
    export async function handleGetVideoStatus(
      request: { params: { arguments: GetVideoStatusToolRequest } },
      apiClient: OpenRouterAPIClient,
    ) {
      const args = request.params.arguments ?? ({} as GetVideoStatusToolRequest);
      const id = args.video_id?.trim();
      if (!id) return toolError(ErrorCode.INVALID_INPUT, 'video_id is required.');
    
      // Pre-resolve save_path so the poll surfaces a fast error before hitting OpenRouter.
      let safeSavePath: string | null = null;
      if (args.save_path) {
        try {
          safeSavePath = await resolveSafeOutputPath(args.save_path);
        } catch (err) {
          if (err instanceof UnsafeOutputPathError) return toolErrorFrom(ErrorCode.UNSAFE_PATH, err);
          return toolErrorFrom(ErrorCode.INTERNAL, err);
        }
      }
    
      let status: VideoJobStatus;
      try {
        status = await apiClient.pollVideoJob(id);
      } catch (err) {
        return classifyUpstreamError(err, 'get_video_status.poll');
      }
    
      if (status.status === 'failed') {
        return toolError(ErrorCode.JOB_FAILED, extractJobError(status), { video_id: id });
      }
      if (status.status === 'completed') {
        try {
          const { content, _meta } = await finalizeCompletedJob(apiClient, status, safeSavePath);
          return { content, _meta };
        } catch (err) {
          if (err instanceof UnsafeOutputPathError) return toolErrorFrom(ErrorCode.UNSAFE_PATH, err);
          return toolErrorFrom(ErrorCode.UPSTREAM_HTTP, err, 'Download');
        }
      }
      return {
        content: [
          {
            type: 'text' as const,
            text: `Video ${id} status: ${status.status}${
              typeof status.progress === 'number' ? ` (progress=${status.progress})` : ''
            }`,
          },
        ],
        isError: false as const,
        _meta: {
          code: ErrorCode.JOB_STILL_RUNNING,
          video_id: id,
          last_status: status.status,
          progress: status.progress,
        },
      };
    }
  • TypeScript interface defining the input schema for get_video_status: requires video_id (string), with optional save_path and polling_url.
    export interface GetVideoStatusToolRequest {
      video_id: string;
      save_path?: string;
      polling_url?: string;
    }
  • Registration of the get_video_status tool definition including its name, description, annotations, and inputSchema for the MCP server's ListToolsRequestSchema handler.
    {
      name: 'get_video_status',
      description:
        'Resume a previously submitted video generation job by id. Returns the latest status; if completed, ' +
        'downloads the video (and saves it when save_path is provided).',
      annotations: {
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
      },
      inputSchema: {
        type: 'object',
        properties: {
          video_id: { type: 'string', description: 'Job id from a previous generate_video call.' },
          save_path: {
            type: 'string',
            description:
              'Optional save path (applies when the job is already completed).',
          },
        },
        required: ['video_id'],
      },
    },
  • Case in the CallToolRequestSchema handler that dispatches 'get_video_status' requests to handleGetVideoStatus, wrapping args with GetVideoStatusToolRequest type.
    case 'get_video_status':
      return handleGetVideoStatus(
        wrapToolArgs(args as GetVideoStatusToolRequest | undefined),
        this.apiClient,
      );
  • Import of handleGetVideoStatus and GetVideoStatusToolRequest from the generate-video module into the main tool-handlers file.
    import {
      handleGenerateVideo,
      handleGetVideoStatus,
    } from './tool-handlers/generate-video.js';
Behavior4/5

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

Annotations indicate readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds that it returns latest status and downloads the video if completed, which provides behavioral context beyond annotations. No contradiction.

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?

Single sentence, front-loaded with the primary action, no unnecessary words. Every part earns its place.

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

Completeness3/5

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

While the description covers the completion case, it omits what happens when the job is still running (e.g., returns status only). No output schema to supplement, leaving a gap for incomplete jobs.

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?

Input schema has 100% coverage with descriptions for video_id and save_path. The description reiterates the save_path usage but does not add new semantic value beyond the schema.

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 the action: 'Resume a previously submitted video generation job by id.' It specifies the resource (video generation job) and distinguishes from siblings like generate_video and analyze_video.

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

Usage Guidelines4/5

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

The description implies usage after a generate_video call, but does not explicitly state when not to use it or mention alternatives. It is clear enough for an agent to infer 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

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/stabgan/openrouter-mcp-multimodal'

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