Skip to main content
Glama
ZLeventer

google-ads-mcp

gads_list_accounts

List all accessible Google Ads customer accounts and retrieve customer IDs for account management and reporting.

Instructions

List all Google Ads customer accounts the authenticated user has access to. Useful for finding customer IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for gads_list_accounts. Calls listAccessibleCustomers() to get resource names, then returns them mapped to customer IDs.
    export async function listAccounts(_args: Record<string, never>) {
      const resourceNames = await listAccessibleCustomers();
      return {
        count: resourceNames.length,
        accounts: resourceNames.map((rn) => ({
          resource_name: rn,
          customer_id: rn.replace("customers/", ""),
        })),
      };
    }
  • Schema for listAccounts — empty object since the tool takes no arguments.
    export const listAccountsSchema = {};
  • src/index.ts:64-69 (registration)
    Registration of gads_list_accounts tool on the MCP server with description, schema, and handler.
    server.tool(
      "gads_list_accounts",
      "List all Google Ads customer accounts the authenticated user has access to. Useful for finding customer IDs.",
      listAccountsSchema,
      async (args) => { try { return ok(await listAccounts(args)); } catch (e) { return err(e); } }
    );
  • Helper function listAccessibleCustomers() that calls the Google Ads API to list all accessible customer accounts.
    export function listAccessibleCustomers(): Promise<string[]> {
      const refresh_token = process.env.GOOGLE_ADS_REFRESH_TOKEN;
      if (!refresh_token) throw new GoogleAdsError("GOOGLE_ADS_REFRESH_TOKEN is not set");
      return getApi().listAccessibleCustomers(refresh_token).then((r) => r.resource_names ?? []);
    }
Behavior2/5

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

No annotations exist, and the description only states the basic function without disclosing behavioral details such as authentication requirements, rate limits, or what 'access' entails.

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?

Two sentences, no wasted words, front-loaded with the core action. Highly concise and well-structured.

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?

Adequate for the tool's simplicity, but could mention output format (e.g., list of account names and IDs) since no output schema is provided.

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?

No parameters, so baseline score of 4 applies. Description adds no parameter info but none is needed.

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?

Description clearly states it lists all Google Ads customer accounts accessible to the user and specifies it is useful for finding customer IDs, providing a specific verb+resource and purpose.

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

Usage Guidelines3/5

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

Description implies when to use (list accounts) but does not explicitly state when not to use or mention alternatives like gads_account_info for a specific account.

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/ZLeventer/google-ads-mcp'

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