write_metering
write_metering
Live server: test server (test.mcp.solvimon.com) only.
Ingests usage events and creates, updates and deletes meter configuration.
Actions: create, update, delete (meter config), ingest, batch_ingest (events)
Resource types: meters, meter_values, meter_value_calculations, meter_properties, meter_data, events
Send one event per discrete unit of activity. Do not pre-aggregate. Each event needs a unique reference (its idempotency key), meter_reference or meter_id, customer_id or customer_reference, and the measured amounts under meter_values[] as {reference, number} pairs. There is no flat value field.
- A meter property is
NUMBER,STRINGorENUM(withenum_values). Passmeter_idto attach it to a meter; on an ACTIVE meter it is created ACTIVE. - Updating a meter’s properties or values replaces its list. An update that would drop an existing entry is refused unless the body has
"allow_detach": true. - On a calculation only
nameanddescriptioncan change. Anything that defines what is measured needs a new calculation. The result lists the product items that use it.
Delete in dependency order: meter properties, then meter value calculations, then meter values, then meters. Product items that reference a meter must first be removed from active plan versions. The calculate action is deprecated; use get_metering calculate_cost.
Example prompts
- “Add a region property (eu, us) to the API requests meter so we can price per region.”
- “Send a test event: one API call for Acme Inc.”
- “Upload these 500 usage events for our customers in one batch.”
- “Rename the token calculation to ‘Tokens per month’.”
- “Make the model property required on the tokens meter.”
Example output
Prompt: “Add a region property (eu, us) to the API requests meter so we can price per region.”
Tool call:
Response (trimmed):
Claude’s answer: The region property is attached to the API requests meter and is ACTIVE, so you can use it in pricing conditions now. It is optional, so existing integrations that don’t send a region keep working; add a default config in the plan for events without one.