Skip to main content
Glama
shigechika

gwsadm-mcp

by shigechika

user_oauth_tokens

List OAuth tokens a user has granted to third-party apps, enabling detection of malicious apps using pre-authorized tokens for Gmail or Drive access without new login events.

Instructions

List third-party OAuth apps one user has granted account access to.

Account-compromise triage tool for the case login_audit and suspended_accounts are both blind to: a malicious app used a previously-granted OAuth token to read/delete mail or Drive files without ever generating a fresh login event. Check each entry's scopes for Gmail/Drive access on an unrecognized client_id/display_text — Google's own apps (e.g. iOS/Android account sync) show up too and are normal noise.

Read-only (Directory API tokens().list; never tokens().delete()). Requires the admin.directory.user.security DWD scope — distinct from admin.directory.user.readonly used by suspended_accounts; a domain missing that grant returns {"error": ...}. No pagination: the API returns a user's full grant list in one response.

Args: username: Exact user email, passed through as the Directory API userKey (primary or alias address both work on Google's side). domain: Configured [domain.*] section to route the lookup through. Default: resolved from the username's suffix. Set it explicitly when the address uses an alias/secondary domain that has no config section of its own (common when copying addresses from mail headers or IdP logs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNo
usernameYes
Behavior5/5

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

Despite no annotations, the description fully discloses read-only nature (Directory API tokens().list, never delete), required scope admin.directory.user.security, error on missing scope, and no pagination (full list in one response).

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?

Well-structured: concise lead sentence, then scenario context, technical details, and parameter docs. Every sentence adds value; no redundancy. Length is appropriate for the complexity.

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

Completeness4/5

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

Covers most aspects: purpose, usage, behavior, parameters. Lacks explicit description of return format (e.g., list of objects with fields like scopes, client_id, display_text). However, the guidance on what to check partially compensates. No output schema exists.

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

Parameters5/5

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

With 0% schema coverage, the description adds essential meaning: username as exact email passed as userKey (primary/alias work), domain for routing with default resolution and explicit use for alias/secondary domains. This far exceeds schema-only info.

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 clearly states the tool lists OAuth tokens granted by a user, differentiating itself from sibling tools like login_audit and suspended_accounts by addressing a specific blind spot: malicious OAuth apps using previously-granted tokens without generating new login events.

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

Usage Guidelines5/5

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

Provides explicit context: use for account-compromise triage when login_audit and suspended_accounts are insufficient. Guides the agent to check scopes for Gmail/Drive access and to ignore Google-owned noise. Also explains domain routing and when to set domain explicitly.

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/shigechika/gwsadm-mcp'

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