Skip to main content
Glama

get_api_key_usage

Read-only

Get per-API-key usage for a given key id: verification counts by type/channel/status, plus verification-request/confirmation/authorization totals, and attribution context (attribution_cutoff_at, attributed_fraction). The counts cover the key and every key it replaced (api_key.replaced_key_ids). Counts only — no recipient identifiers. Scoped to the authenticated account; an API-key caller may read only its own key.

ACCESS: needs a Proof account. Authenticate this client (Claude Code: /mcp → Authenticate), or sign in with start_login — either opens this tool — then call this tool again.

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": {
      "id": "<id>"
    },
    "name": "get_api_key_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe API key id to fetch usage for
environmentNoScope metrics to test or production data (default: production)

Output Schema

NameRequiredDescriptionDefault
api_keyYes
confirmationsYes
verificationsYes
authorizationsYes
attributed_fractionYesFraction of the user verifications linked to any API key in scope (null when there are none)
attribution_cutoff_atYesUTC-day-floored date attribution began for this user (earliest key-linked verification), or null
verification_requestsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "description": "Per-API-key usage: verification counts by type/channel/status + per-collection totals (requests, confirmations, authorizations) + attribution metadata. The counts cover the key and every key it replaced (`api_key.replaced_key_ids`). Counts only — no recipient identifiers (SEC-001). Data is returned for revoked keys (audit).",
      +  "properties": {
      +    "api_key": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "created_at": {
      +          "type": "string"
      +        },
      +        "environment": {
      +          "type": "string"
      +        },
      +        "expires_at": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "id": {
      +          "type": "string"
      +        },
      +        "key_prefix": {
      +          "type": "string"
      +        },
      +        "last_used_at": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "type": "string"
      +        },
      +        "profile_id": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "replaced_key_ids": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "revoked_at": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "scopes": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "name",
      +        "key_prefix",
      +        "environment",
      +        "scopes",
      +        "last_used_at",
      +        "expires_at",
      +        "revoked_at",
      +        "created_at"
      +      ],
      +      "type": "object"
      +    },
      +    "attributed_fraction": {
      +      "description": "Fraction of the user verifications linked to any API key in scope (null when there are none)",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "attribution_cutoff_at": {
      +      "description": "UTC-day-floored date attribution began for this user (earliest key-linked verification), or null",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "authorizations": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "by_status": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "total": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total",
      +        "by_status"
      +      ],
      +      "type": "object"
      +    },
      +    "confirmations": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "by_status": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "total": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total",
      +        "by_status"
      +      ],
      +      "type": "object"
      +    },
      +    "verification_requests": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "by_status": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "total": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total",
      +        "by_status"
      +      ],
      +      "type": "object"
      +    },
      +    "verifications": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "by_channel": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "by_status": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "by_type": {
      +          "additionalProperties": {
      +            "type": "number"
      +          },
      +          "properties": {},
      +          "type": "object"
      +        },
      +        "total": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total",
      +        "by_type",
      +        "by_channel",
      +        "by_status"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "api_key",
      +    "verifications",
      +    "verification_requests",
      +    "confirmations",
      +    "authorizations",
      +    "attribution_cutoff_at",
      +    "attributed_fraction"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • removedInput schema / additionalProperties
      Removed value: -false
  3. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Beyond readOnlyHint=true, the description discloses real behavior: counts aggregate the key plus every key it replaced (api_key.replaced_key_ids), output contains counts only with no recipient identifiers, and access is scoped to the caller's account. The one notable omission is the time window the counts cover — 'usage' over what period is never stated, which matters for interpreting the numbers.

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?

The payload sentence is front-loaded and dense with no padding, followed by the aggregation rule and scoping caveats in a logical order. The ACCESS paragraph is procedural remediation text rather than selection-relevant content, which makes the definition slightly longer than strictly needed.

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

Completeness4/5

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

An output schema exists, so return shape need not be described, and the description still covers scope, aggregation across replaced keys, PII absence, and authentication prerequisites. The remaining gap is the unspecified measurement period for the counts, which an agent needs to interpret the result correctly.

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 description coverage is 100% and both parameters (id, environment with its production default) are documented there, so the schema does the heavy lifting. The description adds a little meaning for id by noting counts also roll in replaced keys and that a key caller is limited to its own id, but it adds nothing for the environment parameter.

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

Purpose4/5

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

The description gives a specific verb and resource ('Get per-API-key usage for a given key id') and enumerates exactly what is returned: verification counts by type/channel/status plus request/confirmation/authorization totals. It clearly contrasts with account-level usage by saying 'per-API-key', though it never names the sibling tool (e.g. get_usage) that would be the alternative.

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?

Usage context is present but indirect: it states the tool is scoped to the authenticated account and that a key caller can only read its own key, which implicitly tells the agent when this tool applies. It gives no explicit when-to-use/when-not rule and never routes the agent to get_usage for account-wide numbers or to list_api_keys to find the id.

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.