Skip to navigation

get_metering

Read meters, usage events and uploads. Trace why an event is (not) billed

Live server: available on mcp.solvimon.com as well as on the test server.

Read-only access to everything related to measuring usage, plus tools to debug it. Check here for a compatible meter before creating a new one.

Actions: list, get, csv_template, download_url, calculate_cost

Resource types: meters, meter_values, meter_value_calculations, meter_properties, meter_property_variables, meter_property_variable_values, meter_data, events, event_trace, files, file_lines

  • Why is this event (not) billed? get on event_trace with an event id or reference shows when it was ingested and processed and what it matched: subscription, product items and invoice (with its number and Desk link). An event without matches says it found no matching subscription.
  • Why did my CSV upload fail? list on files shows recent uploads. list on file_lines with filter.file_id shows the failed rows and why.
  • What would this cost? calculate_cost prices an event against the customer’s current subscription without storing it.
  • csv_template on a meter returns the header row its bulk upload must use.
  • Listing meter_data or events must be narrowed with filter.meter_id or filter.reference.
Trace an event
{"action": "get", "resource_type": "event_trace", "id": "evt-0001"}

Example prompts

  • “Which meters do we have, and what does each one measure?”
  • “Why wasn’t event evt-0001 billed?”
  • “My last usage CSV upload failed. Which rows, and why?”
  • “Give me the CSV header for a bulk upload to the ingested events meter.”
  • “What would 1,000 API calls cost Acme Inc. on their current plan?”

Example output

Prompt: “Give me the CSV header for a bulk upload to the ingested events meter.”

Tool call:

{
"action": "csv_template",
"resource_type": "meters",
"id": "metr_VwDsM40vxDQxcvCZjQ15"
}

Response (trimmed):

{
"csv_template": "customer_reference,pricing_plan_subscription_id (optional),pricing_plan_subscription_reference (optional),reference (unique),timestamp (optional),meter_value.reference.event_count",
"note": "These are the exact headers a bulk upload for this meter must use; never change them. Columns marked \"(optional)\" may be left empty."
}

Claude’s answer: Use this header row as is. Each row needs a customer reference, a unique event reference and the event count; subscription and timestamp columns can stay empty, and the timestamp then defaults to the upload time.