/** * Google Analytics Admin API (GA4) — WRITE MCP tools (create / update / delete / archive). * * The read-only surface lives in ga4Admin.ts; this module is the mutating * counterpart. EVERYTHING here is doubly gated: * 1. env: GA4_MCP_ENABLE_WRITES (create/update) and GA4_MCP_ENABLE_DELETES * (delete AND archive) — both default false, mirroring the GTM guardrails. * 2. per-call: confirm=true is required on every tool. * Writes also need the `analytics.edit` scope (and `analytics.manage.users` for * access-binding tools). See auth/googleAuth GA4_SCOPES. * * DESIGN: GA4 Admin collections are uniform (`create({parent, requestBody})`, * `patch({name, updateMask, requestBody})`, `delete({name})`, * `archive({name, requestBody})`), so a small factory registers the verb tools * from a data-driven catalog. High-frequency resources expose TYPED fields; * complex/rare resources take a raw `body` object (JSON passthrough) so the full * API shape stays reachable without modelling every nested clause. A raw `body` * is merged over any typed fields on both create and update. * * COVERAGE NOTES (documented, not stubbed): * - Search Console links: NOT in the Admin API (UI-only) — no tool. * - Event EDIT rules: the installed googleapis client exposes only event * CREATE rules as a resource — only those are wired. * - Account creation: only provisionAccountTicket (interactive ToS) — omitted. * - Some resources (expanded data sets, subproperty filters, rollup links) are * GA4 360-only and return 400 on standard properties. */ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import type { Ga4AdminClient, Ga4AdminAlphaClient } from '../utils/ga4Client.js'; /** The GA4 Admin API's DataStream has very few writable fields. Everything people REACH for here * (cross-domain domains, unwanted referrals, internal traffic, session timeout) lives in the * GOOGLE TAG settings, which the Admin API does not expose at all - so reject those up front * with directions instead of letting Google return "Unknown name ... Cannot find field". */ export declare function validateDataStreamBody(body: Record, forCreate: boolean): void; export declare function registerGa4AdminWriteTools(server: McpServer, getClient: () => Ga4AdminClient, getAlphaClient: () => Ga4AdminAlphaClient): void; //# sourceMappingURL=ga4AdminWrite.d.ts.map