delete_caption
Remove a caption track from a YouTube video by providing its track ID.
Instructions
Delete a caption track by ID. Use list_captions to find the track ID first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caption_id | Yes | Caption track ID to delete. |
Implementation Reference
- src/tools/captions.ts:119-133 (handler)The handler for the 'delete_caption' tool. It calls client.deleteCaption(args.caption_id) and returns a success message.
server.tool( "delete_caption", "Delete a caption track by ID. Use list_captions to find the track ID first.", deleteCaptionSchema, async (args) => { await client.deleteCaption(args.caption_id); return { content: [ { type: "text" as const, text: `Deleted caption track ${args.caption_id}.`, }, ], }; }, - src/tools/captions.ts:42-44 (schema)Input schema for delete_caption, requiring a 'caption_id' string field.
const deleteCaptionSchema = { caption_id: z.string().describe("Caption track ID to delete."), }; - src/youtube/client.ts:292-296 (helper)YouTubeClient method that sends a DELETE request to the YouTube Data API v3 /captions endpoint with the caption ID.
deleteCaption(captionId: string): Promise<void> { const url = new URL(`${DATA_API}/captions`); url.searchParams.set("id", captionId); return this.request<void>(url.toString(), { method: "DELETE" }); } - src/server.ts:51-51 (registration)Registration of caption tools (including delete_caption) on the MCP server instance.
registerCaptionTools(s, youtube);