list_drives
Display all configured Google Drive accounts available for access through the MCP server. Use this tool to view which connected drives you can interact with for file operations.
Instructions
List all configured Google Drive accounts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/tools/list-drives.ts:27-43 (handler)The handler function for the list_drives tool. It retrieves the list of configured Google Drive accounts using drivesConfigLoader.listDrives(), formats the output as structured content, and provides a text response indicating if no drives are configured.handler: async () => { const drives = drivesConfigLoader.listDrives(); const output = { drives }; return { content: [ { type: "text" as const, text: drives.length === 0 ? "No drives configured yet. Use add_drive to add a Google Drive account." : JSON.stringify(output, null, 2), }, ], structuredContent: output, }; },
- src/mcp/tools/list-drives.ts:11-25 (schema)The tool configuration including inputSchema (empty) and outputSchema defining an optional array of drive objects with id, name, and optional description.config: { title: "List Google Drive Accounts", description: "List all configured Google Drive accounts", inputSchema: {}, outputSchema: { drives: z .array( z.object({ id: z.string(), name: z.string(), description: z.string().optional(), }) ) .optional(), },
- src/mcp/server.ts:27-30 (registration)Dynamic registration of all MCP tools (including list_drives) imported from tools/index.ts. Loops through all exported tools and calls server.registerTool for each.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:7-7 (registration)Central tools index exports listDrivesTool, making it available for bulk import and registration in the MCP server.export { listDrivesTool } from "@/mcp/tools/list-drives.js";
- src/config/config-loader.ts:118-125 (helper)Helper method in DrivesConfigLoader that lists all configured drives, mapping config entries to simplified {id, name, description} objects.listDrives() { const config = this.getConfig(); return Object.entries(config.drives).map(([id, cfg]) => ({ id, name: cfg.name, description: cfg.description, })); }