ingestRawMetricEventsBulk
ingestRawMetricEventsBulkIngest multiple usage events for a resource slug in one bulk API call, ideal for CSV or batch imports that would otherwise require one request per event.
Instructions
Ingest MULTIPLE Usage Events for the specified resource slug in a single API call (bulk ingestion). Use this instead of calling ingestRawMetricEvent once per event — it sends one HTTP request carrying every event, which is far more efficient for CSV/batch imports. Each element of 'events' has the same shape as ingestRawMetricEvent's 'event' arg: customer_id, timestamp, and a data map with schema-compliant types. If importing from a CSV (or any source) whose column names don't clearly correspond to the expected fields (customer_id, timestamp, data.*), confirm the mapping with the user before constructing events — do not guess a mapping silently. Limit: 500 events per call — split larger batches into multiple calls. Host enforces user confirmation via the approval gate; do NOT ask the user to re-confirm before calling.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rawMetricSlug": "<rawMetricSlug>",
"events": "<events>"
},
"name": "ingestRawMetricEventsBulk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| events | Yes | Array of Usage Event payloads, each containing customer_id, timestamp, and a data map with schema-compliant types — same shape as ingestRawMetricEvent's 'event' arg, but plural. customer_id and timestamp are mandatory on EVERY event; MCP does not auto-add them. Events are validated server-side against the raw metric's real schema before anything is sent — an unknown data field or wrong type is rejected with the exact list of valid fields, so you do NOT need to pre-fetch the schema via getRawMetricBySlug first; only do so if you're unsure what fields/types this raw metric expects. Maximum 500 events per call — if you have more, split into multiple calls to this tool. Prefer 100–200 events per call: batches approaching 500 consume significant context, more so under stateless approval (the batch is base64-packed into the approval token and echoed back verbatim). Example event shape: {"customer_id": "example_customer", "timestamp": "2025-01-01 00:00:00", "data": {"String": "sample value", "Int64": 10, "Float64": 42.5}}. | |
| __userContext | No | Internal user context for multi-tenant authentication and approval workflow | |
| rawMetricSlug | Yes | Slug of the Usage Event resource (raw metric), e.g. api_usage_events. |