Skip to main content
Glama

Get PubNub Usage Metrics

get_usage_metrics

Retrieve usage metrics from PubNub Admin API for an account, app, or keyset to analyze transaction volumes, message counts, and storage usage over a specified date range.

Instructions

Fetches usage metrics from the PubNub Admin API for an account, app, or keyset.

  **Parameters:**
  - entityType: 'account', 'app', or 'keyset'
  - entityId: The ID of the entity
  - from: Start date (inclusive) in YYYY-MM-DD format
  - to: End date (exclusive) in YYYY-MM-DD format
  - metrics: Array of metric names to retrieve

  **Available Metric Categories:**
  - Core transactions: txn_total, mtd_txn_total, replicated, signals, edge
  - MAU/UUID: mtd_uuid, uuid, pn_uuid
  - Messages: msgs_total, publish, subscribe_msgs, history_msgs, files_msgs, push_msgs
  - Storage: bytes_stored, bytes_stored_messages, bytes_stored_files, etc.
  - Access Manager: accessmanager_grants_transactions, accessmanager_audits_transactions
  - Functions: executions, kv_read_transactions, kv_write_transactions
  - History: history_transactions, history_with_actions_transactions
  - Message Actions: message_actions_add_transactions, message_actions_get_transactions
  - Objects/App Context: objects_create_user_transactions, objects_get_user_transactions, etc.
  - Presence: presence_herenow_transactions, presence_wherenow_transactions
  - Push Notifications: apns_sent_transactions, gcm_sent_transactions
  - Subscribe: subscribe_transactions, subscribe_heartbeats_transactions
  - Publish: publish_transactions, publish_bytes
  - Signal: signal_transactions
  - Files: files_publish_transactions, files_get_file_transactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityTypeYesThe type of entity to fetch metrics for: 'account', 'app', or 'keyset'.
entityIdYesThe ID of the entity (account ID, app ID, or keyset ID).
fromYesStart date (inclusive) in YYYY-MM-DD format.
toYesEnd date (exclusive) in YYYY-MM-DD format.
metricsYesArray of metric names to retrieve.
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It does not mention rate limits, authentication needs, destructive potential, or response structure. Listing parameters and metrics is helpful but insufficient for behavioral transparency.

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

Conciseness3/5

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

The description is structured with headings and separates parameter info from metric categories, but it is lengthy due to the exhaustive list of 75+ metrics. This could be trimmed or referenced externally to improve conciseness without losing clarity.

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

Completeness2/5

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

Given the complexity (5 parameters, many enum values, no output schema or annotations), the description lacks return format, error handling, rate limits, and prerequisites. It explains parameters and metrics but leaves the overall usage context incomplete.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all parameters. The description adds value by summarizing parameter types and listing available metric categories, but does not provide deeper semantics beyond the schema. Baseline 3 is appropriate.

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?

The description clearly states 'Fetches usage metrics from the PubNub Admin API for an account, app, or keyset.' It specifies the verb (fetches), resource (usage metrics), and scope (account/app/keyset), distinguishing it from sibling tools like get_pubnub_messages or manage_apps which cover different data.

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

Usage Guidelines3/5

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

The description explains what the tool does but offers no guidance on when to use it versus alternatives, nor any exclusions. It implicitly suggests usage for retrieving metrics, but lacks explicit context or comparisons to siblings like get_pubnub_presence.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pubnub/pubnub-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server