Skip to main content
Glama

runway_cancelTask

Cancel or delete a running video or image generation task to stop processing and free up resources when no longer needed.

Instructions

Deletes or cancels a given task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes

Implementation Reference

  • The handler function for runway_cancelTask. It performs a DELETE request to `/tasks/${taskId}` using the callRunway helper and returns a success message.
    async ({ taskId }) => { await callRunway(`/tasks/${taskId}`, { method: "DELETE" }); return { content: [{ type: "text", text: `Task ${taskId} cancelled.` }] }; }
  • Zod input schema defining the required 'taskId' parameter as a string.
    { taskId: z.string() },
  • src/index.ts:200-207 (registration)
    Registration of the runway_cancelTask tool using server.tool, specifying name, description, input schema, and inline handler function.
    "runway_cancelTask", "Deletes or cancels a given task.", { taskId: z.string() }, async ({ taskId }) => { await callRunway(`/tasks/${taskId}`, { method: "DELETE" }); return { content: [{ type: "text", text: `Task ${taskId} cancelled.` }] }; } );
  • Utility function that makes HTTP requests to the Runway API with authentication headers, used by the tool handler for the DELETE operation.
    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