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
| Name | Required | Description | Default |
|---|---|---|---|
| driveId | Yes | ID of the drive to remove |
Implementation Reference
- src/mcp/tools/remove-drive.ts:22-34 (handler)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, }; },
- src/mcp/tools/remove-drive.ts:11-21 (schema)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(), }, },
- src/mcp/server.ts:26-30 (registration)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); });
- src/mcp/tools/index.ts:9-9 (registration)Re-export of the removeDriveTool from its implementation file, allowing central import in server.ts.export { removeDriveTool } from "@/mcp/tools/remove-drive.js";
- src/config/config-loader.ts:162-173 (helper)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}`); }