Skip to main content
Glama

google_drive_delete_file

Remove a file from Google Drive by specifying its ID, with the option to permanently delete it or move it to trash. Simplifies file management within the Google MCP ecosystem.

Instructions

Delete a file from Google Drive

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileIdYesID of the file to delete
permanentlyNoWhether to permanently delete the file or move it to trash

Implementation Reference

  • The handler function that executes the logic for the 'google_drive_delete_file' tool. It validates the input arguments using isDeleteFileArgs and calls the GoogleDrive instance's deleteFile method.
    export async function handleDriveDeleteFile(
      args: any,
      googleDriveInstance: GoogleDrive
    ) {
      if (!isDeleteFileArgs(args)) {
        throw new Error("Invalid arguments for google_drive_delete_file");
      }
      const { fileId, permanently } = args;
      const result = await googleDriveInstance.deleteFile(fileId, permanently);
      return {
        content: [{ type: "text", text: result }],
        isError: false,
      };
    }
  • The Tool object definition for 'google_drive_delete_file', including the input schema for validation.
    export const DELETE_FILE_TOOL: Tool = {
      name: "google_drive_delete_file",
      description: "Delete a file from Google Drive",
      inputSchema: {
        type: "object",
        properties: {
          fileId: {
            type: "string",
            description: "ID of the file to delete",
          },
          permanently: {
            type: "boolean",
            description:
              "Whether to permanently delete the file or move it to trash",
          },
        },
        required: ["fileId"],
      },
    };
  • Switch case in the tool call handler that registers and routes 'google_drive_delete_file' calls to the appropriate handler function.
    case "google_drive_delete_file":
      return await driveHandlers.handleDriveDeleteFile(
        args,
        googleDriveInstance
      );
  • Type guard function used in the handler to validate arguments for 'google_drive_delete_file'.
    export function isDeleteFileArgs(args: any): args is {
      fileId: string;
      permanently?: boolean;
    } {
      return (
        args &&
        typeof args.fileId === "string" &&
        (args.permanently === undefined || typeof args.permanently === "boolean")
      );
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose critical behavioral traits: whether deletion is reversible/irreversible, authentication requirements, error conditions (e.g., permission denied), rate limits, or what happens to shared links. The description mentions 'delete' but doesn't elaborate on the 'permanently' parameter's implications.

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 is a single, efficient sentence with zero wasted words. It's appropriately sized for a simple delete operation and front-loads the core action. Every word earns its place.

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

Completeness2/5

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

For a destructive mutation tool with no annotations and no output schema, the description is inadequate. It doesn't cover behavioral aspects (reversibility, permissions), error handling, or return values. Given the complexity of file deletion with permanent/trash options, more context is needed for safe usage.

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

Parameters3/5

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

Schema description coverage is 100%, providing good documentation for both parameters. The description adds no parameter semantics beyond what's in the schema—it doesn't explain fileId format, default behavior for 'permanently', or consequences of different boolean values. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a file from Google Drive'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'google_drive_update_file' or 'google_drive_share_file' beyond the obvious action difference, nor does it mention the 'permanently' parameter's effect on trash vs permanent deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing file ID from list_files), warn about irreversible deletion, or compare to similar tools like 'google_drive_update_file' for modification instead of deletion.

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

Related 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/vakharwalad23/google-mcp'

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