MeteraDOCS
Request access

Live todayLive

Watches

A watch keeps verifying an address for you. What notices a change (polling today) is never trusted as the fact: it only wakes a real re-verification, the same dual-RPC call get_verified_data runs, with a real traceId and real billing.

create_watch

ParameterTypeRequiredDescription
typestringyesA watchable type: solana.resolve_address, solana.can_sign, solana.token_risk, solana.pool_state or solana.token_account_owner. Other types are refused by name.
paramsobjectyesThe same params get_verified_data takes for that type.
condition.fieldstringnoThe field to compare.
condition.changesbooleannoFire only when the field differs from the previous delivery.
condition.crosses + condition.directionnumber + above | belownoFire only when the field crosses the threshold.
minIntervalSecondsnumbernoDebounce. A trigger within this window of the last notification is dropped before any re-verification runs. Default 30.
webhookUrlstringnoIf given, deliveries are also pushed here, HMAC-signed in the body.

Without a condition, you are notified on every re-verified delivery. Both condition forms need a real prior delivery to compare against, so neither fires on the first re-verification.

Example: alert when the authority on a token account changes.

json
// tool: create_watch
{
  "type": "solana.token_account_owner",
  "params": { "account": "<TREASURY_USDC_ATA>" },
  "condition": { "field": "owner", "changes": true },
  "minIntervalSeconds": 60,
  "webhookUrl": "https://your-app.example/hooks/metera"
}

The webhookSecret is shown once, at creation. Store it; list_watches never returns it.

poll_watch

Most MCP clients have no public endpoint for a webhook. poll_watch is the alternative: it returns every re-verified delivery you have not read yet, across all watches or for one watchId. Each delivery is returned exactly once. Free.

list_watches

Every watch on the account, without secrets. Real response on a new account:

json
{ "watches": [] }

delete_watch

Removes the watch and stops its trigger immediately: the real subscription, not just the record. A watchId you do not own and one that does not exist are refused the same way.

Verifying a webhook

Deliveries pushed to webhookUrl are HMAC-signed with your webhookSecret. The signature travels in the body. Recompute the HMAC over the signed content and compare in constant time before trusting it. The sketch below assumes HMAC-SHA256 in hex.

ts
import { createHmac, timingSafeEqual } from "node:crypto";

export function isFromMetera(rawBody: string, signature: string, secret: string) {
  const expected = createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(signature);
  return a.length === b.length && timingSafeEqual(a, b);
}

Billing: registering, listing, polling and deleting are free. Only a delivered, re-verified notification is billed, exactly like get_verified_data.