Skip to main content
Glama
flt-sudo

gmail-mcp-server

by flt-sudo

Add Gmail account

gmail_add_account

Authenticate a Gmail account through a browser OAuth flow, selecting access level (readonly, modify, or send), an optional alias, and whether it becomes the default account.

Instructions

Add (or re-authenticate) a Gmail account via a browser OAuth consent flow on this machine.

Args:

  • access ("readonly" | "modify" | "send", default "modify"): readonly = search and read only; modify = read plus labels, trash, drafts; send = modify plus send and reply.

  • allow_send (boolean, legacy): same as access "send"; ignored when access is set.

  • alias (string, optional): short name usable anywhere an 'account' parameter is accepted.

  • set_default (boolean, default false): make this the default account. The first account added is always the default.

Returns: the authenticated email address and granted scopes. A browser window opens for consent; if it does not, the consent URL is included in the response for manual opening. Re-adding an existing email overwrites its stored credentials (this is the re-auth path).

Examples:

  • {"access": "readonly"} — add a read-only account

  • {} — add an account that can read, label, trash, and draft, but not send

  • {"access": "send", "alias": "work", "set_default": true}

Error Handling: returns an actionable error if OAuth client credentials are missing (see README setup), if the user denies consent, or if the flow times out (5 minutes).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasNoOptional short name for this account (e.g. 'personal', 'work').
accessNoAccess level. 'readonly' = search and read only (gmail.readonly). 'modify' = read plus labels, trash, drafts (gmail.modify). 'send' = modify plus send and reply. Overrides allow_send. Default 'modify'.
allow_sendNoLegacy flag, same as access: 'send'. Ignored when access is set. Default false.
set_defaultNoMake this account the default for calls that omit 'account'. The first account added always becomes the default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations provide the safety profile, and the description adds substantial behavioral context: a browser window opens, a fallback consent URL is provided, re-adding overwrites existing credentials, and error conditions (missing OAuth client, denied consent, 5-minute timeout) are listed. No contradiction with annotations.

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 long but organized into labeled sections (Args, Returns, Examples, Error Handling) with a one-line lead. Every section carries necessary information for a complex OAuth flow; nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 optional parameters, no output schema, and external side effects, the description is complete: it covers return values, side effects, auth behavior, timeouts, and errors. An agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds value with concrete usage examples, clarifies the legacy allow_send relationship, and explains that alias is usable anywhere an 'account' parameter is accepted — details that help an agent choose values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Add (or re-authenticate)'), the resource ('Gmail account'), and the mechanism ('browser OAuth consent flow'). This distinguishes it from sibling tools like gmail_remove_account and gmail_list_accounts without needing to open the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly identifies when to use the tool (initial setup or re-auth via OAuth) and explains the flow. It does not explicitly name alternatives or exclusions, but the sibling set makes the context unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.