Skip to main content
Glama

Set Metric

set_metric
DestructiveIdempotent

Set 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

NameRequiredDescriptionDefault
keyYesMetric key (from list_metrics): 1 to 40 characters, letters, digits, "-" and "_", starting with a letter or digit. Lowercased for you.
unitNoAn 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.
labelNoName shown beside the value (at most 24 characters). Defaults to the key for a new metric.
valueYesThe 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.
formatNoHow 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_codeYesRoom invite code.

Output Schema

NameRequiredDescriptionDefault
resultYesA 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations it discloses real behavior: no ping and no push are emitted, an identical value is a no-op that preserves the updated time, a new metric inherits defaults from the key and value type, and stored values are raw. These are exactly the side-effect and idempotency details an agent cannot infer from destructiveHint/idempotentHint alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action and its create-on-new behavior, then prerequisites and side effects. Every sentence carries information, though several are densely multi-clause (defaults plus formatting rules in one line), which slightly reduces scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With annotations covering the safety profile and an output schema covering returns, the description fills the remaining gaps: permissions, capacity limit, no-op semantics, notification behavior and formatting defaults. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description goes further by explaining the label/format defaults for new metrics, that numbers keep four decimal places, and that values are unformatted raw data. It adds genuine meaning on top of an already well-documented schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Set a room metric's value, creating the metric when the key is new" gives a specific verb, resource and upsert semantics, which cleanly separates it from delete_metric and list_metrics without needing to name them. The 8-metric ceiling further pins down the scope of the write.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the prerequisite condition clearly ("Needs a room the account owns or administers") and implies this is the create-or-update path for metrics. It does not explicitly say when to prefer another tool or what to do when the room already holds 8 metrics, so a small routing gap remains.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources