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
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes |
Implementation Reference
- src/index.ts:203-206 (handler)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.` }] }; }
- src/index.ts:202-202 (schema)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.` }] }; } );
- src/index.ts:27-42 (helper)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(); }