Skip to main content
Glama

Google Ads MCP Server

by martechery
accounts.test.ts1.21 kB
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { listAccessibleCustomers } from '../../src/tools/accounts.js'; declare const global: any; describe('listAccessibleCustomers', () => { const OLD_ENV = process.env; beforeEach(() => { vi.restoreAllMocks(); process.env = { ...OLD_ENV }; process.env.GOOGLE_ADS_ACCESS_TOKEN = 'tkn'; process.env.GOOGLE_ADS_DEVELOPER_TOKEN = 'dev'; global.fetch = vi.fn(async () => ({ ok: true, status: 200, json: async () => ({ resourceNames: ['customers/1234567890', 'customers/0000012345'] }), text: async () => '', })); }); afterEach(() => { process.env = OLD_ENV; vi.resetAllMocks(); }); it('calls listAccessibleCustomers and parses resourceNames', async () => { const res = await listAccessibleCustomers(); expect(res.ok).toBe(true); expect(res.data?.resourceNames?.length).toBe(2); expect(global.fetch).toHaveBeenCalledTimes(1); const [url, init] = global.fetch.mock.calls[0]; expect(url).toContain('/v21/customers:listAccessibleCustomers'); expect(init.method).toBe('GET'); expect(init.headers.Authorization).toBe('Bearer tkn'); }); });

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

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