Skip to main content
Glama

runway_getTask

Retrieve task status and results from Runway API operations. Check if video or image generation tasks have completed successfully, failed, or are still processing.

Instructions

Get the details of a task, if the task status is 'SUCCEEDED', there will be a 'url' field in the response. If the task status is 'FAILED', there will be a 'error' field in the response. If the task status is 'PENDING' or 'RUNNING', you can call this tool again in 5 seconds to get the task details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes

Implementation Reference

  • The handler function for the 'runway_getTask' tool. It fetches the task details from the Runway API endpoint `/tasks/${taskId}` using the `callRunway` helper and returns the result as a JSON string in the response content.
    async ({ taskId }) => {
      const task = await callRunway(`/tasks/${taskId}`);
      return { content: [{ type: "text", text: JSON.stringify(task) }] };
    }
  • The input schema for the 'runway_getTask' tool, defining a single required parameter 'taskId' as a string.
    {
      taskId: z.string(),
    },
  • src/index.ts:186-196 (registration)
    The registration of the 'runway_getTask' tool on the MCP server, specifying the tool name, description, input schema, and handler function.
    server.tool(
      "runway_getTask",
      "Get the details of a task, if the task status is 'SUCCEEDED', there will be a 'url' field in the response. If the task status is 'FAILED', there will be a 'error' field in the response. If the task status is 'PENDING' or 'RUNNING', you can call this tool again in 5 seconds to get the task details.",
      {
        taskId: z.string(),
      },
      async ({ taskId }) => {
        const task = await callRunway(`/tasks/${taskId}`);
        return { content: [{ type: "text", text: JSON.stringify(task) }] };
      }
    );
  • Helper function used by the 'runway_getTask' handler to make authenticated API calls to the Runway service.
    async function callRunway(
      path: string,
      opts: Partial<RequestInit> = {}
    ): Promise<unknown> {
      const res = await fetch(`${API_BASE}${path}`, {
        ...opts,
        headers: {
          Authorization: `Bearer ${SECRET}`,
          "X-Runway-Version": RUNWAY_VERSION,
          "Content-Type": "application/json",
          ...(opts.headers || {}),
        },
      } as RequestInit);
      if (!res.ok) throw new Error(`Runway ${res.status}: ${await res.text()}`);
      return res.json();
    }

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/runwayml/runway-api-mcp-server'

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