Skip to main content
Glama

delete_video

Permanently delete a YouTube video by ID. Requires exact title confirmation to prevent irreversible removal of the wrong video.

Instructions

Permanently delete a video. Requires confirm_video_title to match the video's current title exactly — guards against deleting the wrong video by ID. Deletion is irreversible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
video_idYesVideo ID to delete.
confirm_video_titleYesExact current title of the video. Must match what YouTube returns to proceed — prevents accidental deletion of the wrong video.

Implementation Reference

  • The handler function that executes the delete_video tool logic. It fetches the video to verify the title matches confirm_video_title (as a safety check), then calls client.deleteVideo() to permanently delete it.
    async (args) => {
      const current = await client.getVideo(args.video_id);
      const video = current.items[0];
      if (!video) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Video not found: ${args.video_id}`,
            },
          ],
        };
      }
      const actualTitle = video.snippet?.title ?? "";
      if (actualTitle !== args.confirm_video_title) {
        throw new Error(
          `confirm_video_title mismatch. Expected exact title "${actualTitle}", got "${args.confirm_video_title}". Aborting delete.`,
        );
      }
      await client.deleteVideo(args.video_id);
      return {
        content: [
          {
            type: "text" as const,
            text: `Deleted video ${args.video_id} ("${actualTitle}").`,
          },
        ],
      };
    },
  • Input schema for delete_video, requiring a video_id string and a confirm_video_title string that must match the actual video title to prevent accidental deletion.
    const deleteVideoSchema = {
      video_id: z.string().describe("Video ID to delete."),
      confirm_video_title: z
        .string()
        .describe(
          "Exact current title of the video. Must match what YouTube returns to proceed — prevents accidental deletion of the wrong video.",
        ),
    };
  • Registration of the delete_video tool via server.tool() with name 'delete_video', description, schema, and handler.
    server.tool(
      "delete_video",
      "Permanently delete a video. Requires confirm_video_title to match the video's current title exactly — guards against deleting the wrong video by ID. Deletion is irreversible.",
      deleteVideoSchema,
      async (args) => {
        const current = await client.getVideo(args.video_id);
        const video = current.items[0];
        if (!video) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Video not found: ${args.video_id}`,
              },
            ],
          };
        }
        const actualTitle = video.snippet?.title ?? "";
        if (actualTitle !== args.confirm_video_title) {
          throw new Error(
            `confirm_video_title mismatch. Expected exact title "${actualTitle}", got "${args.confirm_video_title}". Aborting delete.`,
          );
        }
        await client.deleteVideo(args.video_id);
        return {
          content: [
            {
              type: "text" as const,
              text: `Deleted video ${args.video_id} ("${actualTitle}").`,
            },
          ],
        };
      },
    );
  • src/server.ts:47-47 (registration)
    Registration call in the main server setup that wires up all video tools including delete_video via registerVideoTools.
    registerVideoTools(s, youtube);
  • The YouTube API client method that performs the actual HTTP DELETE request to YouTube's Data API v3 /videos endpoint.
    deleteVideo(videoId: string): Promise<void> {
      const url = new URL(`${DATA_API}/videos`);
      url.searchParams.set("id", videoId);
      return this.request<void>(url.toString(), { method: "DELETE" });
    }
Behavior4/5

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

Without annotations, the description fully discloses that deletion is irreversible and includes a guard mechanism to prevent errors. It does not cover authorization or rate limits but sufficiently communicates the destructive nature.

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?

The description consists of two concise sentences that front-load the purpose and add essential behavioral details without redundancy.

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

Completeness4/5

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

The description covers purpose, irreversibility, and the guard mechanism. No output schema exists, so return values are omitted. It does not mention error cases or prerequisites, but is adequate for the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, providing baseline 3. The description adds meaning by explaining that confirm_video_title must match the exact current title, going beyond the schema's description.

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 'Permanently delete' and the resource 'a video'. It distinguishes from sibling tools like delete_caption by specifying 'video', making the purpose unambiguous.

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 for deleting a video and explains the confirmation guard. It does not explicitly state when not to use or suggest alternatives, but the context of sibling tools makes the usage clear.

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/miller-joe/youtube-mcp'

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