Skip to main content
Glama

Google Ads MCP Server

by martechery
formatCsv.ts730 B
function getByPath(obj: any, path: string): any { const parts = path.split('.'); let cur = obj; for (const p of parts) { if (cur == null) return undefined; cur = cur[p]; } return cur; } function csvEscape(val: any): string { if (val === null || val === undefined) return ''; const s = String(val); if (s.includes('"') || s.includes(',') || s.includes('\n')) { return '"' + s.replace(/"/g, '""') + '"'; } return s; } export function toCsv(rows: any[], fields: string[]): string { const header = fields.join(','); const lines = [header]; for (const r of rows) { const vals = fields.map((f) => csvEscape(getByPath(r, f))); lines.push(vals.join(',')); } return lines.join('\n'); }

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