Skip to main content
Glama
andresfrei

Google Drive MCP Server

by andresfrei

remove_drive

Remove a Google Drive account from the configuration by providing the drive ID to disconnect access.

Instructions

Remove a Google Drive account from the configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
driveIdYesID of the drive to remove

Implementation Reference

  • The asynchronous handler function that executes the remove_drive tool logic: destructures driveId, calls drivesConfigLoader.removeDrive(driveId), and returns a structured response with success message.
    handler: async (params: { driveId: string }) => {
      const { driveId } = params;
      drivesConfigLoader.removeDrive(driveId);
      const output = {
        success: true,
        message: `Drive "${driveId}" removed successfully`,
      };
    
      return {
        content: [{ type: "text" as const, text: `✅ ${output.message}` }],
        structuredContent: output,
      };
    },
  • Input and output schema definitions for the remove_drive tool using Zod, specifying driveId as string input and success boolean + message string output.
    config: {
      title: "Remove Google Drive Account",
      description: "Remove a Google Drive account from the configuration",
      inputSchema: {
        driveId: z.string().describe("ID of the drive to remove"),
      },
      outputSchema: {
        success: z.boolean(),
        message: z.string(),
      },
    },
  • Dynamic registration of all imported tools (including remove_drive) to the MCP server by iterating over Object.values(tools) and calling server.registerTool for each.
    // Registro automático de todas las tools
    const toolList = Object.values(tools);
    toolList.forEach((tool) => {
      server.registerTool(tool.name, tool.config as any, tool.handler as any);
    });
  • Re-export of the removeDriveTool from its implementation file, allowing central import in server.ts.
    export { removeDriveTool } from "@/mcp/tools/remove-drive.js";
  • Underlying helper method in DrivesConfigLoader that removes the drive from the config by deleting the entry, saving the config, and logging.
    removeDrive(driveId: string) {
      const config = this.getConfig();
    
      if (!config.drives[driveId]) {
        throw new Error(`Drive "${driveId}" not found`);
      }
    
      delete config.drives[driveId];
      this.saveConfig(config);
    
      logger.info(`Removed drive: ${driveId}`);
    }

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/andresfrei/mcp-drive'

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