Set Metric
set_metricSet a room metric's value, creating the metric when the key is new (a room holds at most 8). Sends no ping and no push. Needs a room the account owns or administers. A value equal to the stored one changes nothing and keeps its updated time. A new metric's label defaults to the key and its format to number (for a number) or text (for a string); numbers keep four decimal places. Values are raw: clients format them for the reader.
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": {
"invite_code": "<invite_code>",
"key": "<key>",
"value": "<value>"
},
"name": "set_metric"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Metric key (from list_metrics): 1 to 40 characters, letters, digits, "-" and "_", starting with a letter or digit. Lowercased for you. | |
| unit | No | An ISO 4217 code such as USD for the currency format, short free text such as ms for the unit format. Not allowed for the other formats. | |
| label | No | Name shown beside the value (at most 24 characters). Defaults to the key for a new metric. | |
| value | Yes | The value: a finite number with an absolute value of at most 1e15 for the number, currency, percent and unit formats, or a string of at most 24 characters for the text format. | |
| format | No | How clients show the value: number, currency (needs unit: an ISO 4217 code), percent, unit (needs unit: free text such as ms) or text. Defaults to number or text by the value's type for a new metric. | |
| invite_code | Yes | Room invite code. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | A room metric: a named value a widget shows. `value` is raw (a number for the numeric formats, a string for text, null until set); clients format it for the reader. |