Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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, }; },
  • 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(), },
  • 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); });
  • 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";
  • 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, })); }

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