send_offline_event
Send offline conversion events to an offline event set for tracking and attribution.
Instructions
Send an offline conversion event to an offline event set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_set_id | Yes | Offline event set ID | |
| events | Yes | JSON array of offline events |
Implementation Reference
- src/tools/conversions.ts:23-39 (handler)The handler function for the 'send_offline_event' tool. It destructures event_set_id from params and posts to /{event_set_id}/events via the AdsClient. Error handling returns structured error content.
// ─── send_offline_event ──────────────────────────────────── server.tool( "send_offline_event", "Send an offline conversion event to an offline event set.", { event_set_id: z.string().describe("Offline event set ID"), events: z.string().describe("JSON array of offline events"), }, async ({ event_set_id, ...params }) => { try { const { data, rateLimit } = await client.post(`/${event_set_id}/events`, { ...params }); return { content: [{ type: "text" as const, text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text" as const, text: `Failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/conversions.ts:27-29 (schema)Input schema for send_offline_event: requires event_set_id (string) and events (string - JSON array of offline events).
{ event_set_id: z.string().describe("Offline event set ID"), events: z.string().describe("JSON array of offline events"), - src/tools/conversions.ts:5-5 (registration)Registration function: registerConversionTools is exported and called from src/index.ts (line 79) with the server and client instances.
export function registerConversionTools(server: McpServer, client: AdsClient): void {