Skip to main content
Glama
andresfrei

Google Drive MCP Server

by andresfrei

add_drive

Add a new Google Drive account to the configuration using service account authentication, enabling access to multiple drives for file operations.

Instructions

Add a new Google Drive account to the configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoOptional description
driveIdYesUnique ID for this drive (e.g., 'personal', 'work')
nameYesDisplay name for the drive
serviceAccountPathYesPath to Service Account JSON file (e.g., './credentials/personal-sa.json')

Implementation Reference

  • The async handler function that executes the add_drive tool: destructures params, calls drivesConfigLoader.addDrive, constructs success output, and returns MCP-formatted content with text confirmation and structured data.
    handler: async (params: {
      driveId: string;
      name: string;
      description?: string;
      serviceAccountPath: string;
    }) => {
      const { driveId, name, description, serviceAccountPath } = params;
      const added = drivesConfigLoader.addDrive(driveId, {
        name,
        description,
        serviceAccountPath,
      });
    
      const output = {
        success: true,
        drive: { id: driveId, name, description },
      };
    
      return {
        content: [
          {
            type: "text" as const,
            text: `✅ Drive added successfully:\n${JSON.stringify(added, null, 2)}`,
          },
        ],
        structuredContent: output,
      };
    },
  • Tool configuration including Zod-based inputSchema (driveId, name, optional description, serviceAccountPath) and outputSchema (success boolean and drive object).
    config: {
      title: "Add Google Drive Account",
      description: "Add a new Google Drive account to the configuration",
      inputSchema: {
        driveId: z
          .string()
          .describe("Unique ID for this drive (e.g., 'personal', 'work')"),
        name: z.string().describe("Display name for the drive"),
        description: z.string().optional().describe("Optional description"),
        serviceAccountPath: z
          .string()
          .describe(
            "Path to Service Account JSON file (e.g., './keys/personal-sa.json')"
          ),
      },
      outputSchema: {
        success: z.boolean(),
        drive: z.object({
          id: z.string(),
          name: z.string(),
          description: z.string().optional(),
        }),
      },
    },
  • Dynamic registration loop that registers all tools (including add_drive via import * as tools from "@/mcp/tools/index.js") using McpServer.registerTool with name, config, and handler.
    const toolList = Object.values(tools);
    toolList.forEach((tool) => {
      server.registerTool(tool.name, tool.config as any, tool.handler as any);
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Add' implies a write/mutation operation but doesn't cover critical aspects like whether this requires admin permissions, if it's idempotent, what happens on duplicate driveId, or error handling. For a configuration tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse at a glance.

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?

Given the complexity of adding a Google Drive account (involving authentication via service accounts) and the absence of both annotations and an output schema, the description is insufficient. It doesn't explain what 'configuration' means, what the tool returns (e.g., success confirmation or error), or how it integrates with sibling tools. For a mutation tool with no structured support, more context is needed.

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%, so the input schema fully documents all parameters (driveId, name, serviceAccountPath, description). The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between parameters or usage examples. Baseline 3 is appropriate when the schema does all the work.

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 ('Add') and resource ('new Google Drive account to the configuration'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_drives' or 'remove_drive', which would require mentioning it's for configuration setup rather than data operations.

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 like 'list_drives' for viewing existing drives or 'remove_drive' for deletion. The description lacks context about prerequisites (e.g., needing a service account file) or typical scenarios (e.g., initial setup vs. adding multiple drives).

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

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-google-drive-server'

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