Skip to main content
Glama

Get usage

get_usage
Read-only

View your account's spend breakdown by role, meter, and agent, including recent runs. Use it to see exactly where your credits went.

Instructions

Get the authenticated account's usage rollup (US-dollar spend by role, meter, and agent, with recent runs). Use this to answer where the money went; for the current balance use get_credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolsYes
agentsYes
totalsYes
by_kindYes
by_roleYes
workflowsYes
recent_runsYes
workflow_executionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv0.16.2
    • addedOutput schema / properties / by_role
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "advisor": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    },
      +    "executor": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    },
      +    "reviewer": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "executor",
      +    "advisor",
      +    "reviewer"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / advisor
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Gross advisor consumption for the turn; the cap compares against this amount.",
      +  "properties": {
      +    "calls_allowed": {
      +      "type": "integer"
      +    },
      +    "calls_used": {
      +      "type": "integer"
      +    },
      +    "spend_cap_micro_usd": {
      +      "type": [
      +        "null",
      +        "integer"
      +      ]
      +    },
      +    "spend_micro_usd": {
      +      "description": "Gross advisor consumption for the turn; the cap compares against this amount.",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "calls_used",
      +    "calls_allowed",
      +    "spend_micro_usd"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / credits / description
      Added value: +"The net charge after any refund."
    • addedOutput schema / properties / recent_runs / items / properties / error / properties / upgrade
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Which plan lifts the limit this run ended at, when it ended at one.",
      +  "properties": {
      +    "anonymous": {
      +      "type": "boolean"
      +    },
      +    "limit": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "offer": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "discount_code": {
      +          "type": "string"
      +        },
      +        "first_period_price_micro_usd": {
      +          "type": "integer"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "discount_code",
      +        "first_period_price_micro_usd",
      +        "message"
      +      ],
      +      "type": [
      +        "null",
      +        "object"
      +      ]
      +    },
      +    "plan": {
      +      "type": "string"
      +    },
      +    "remedies": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "kind": {
      +            "type": "string"
      +          },
      +          "limits": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "disk_gb": {
      +                "type": "integer"
      +              },
      +              "max_active_workflows": {
      +                "type": "integer"
      +              },
      +              "max_agents": {
      +                "type": "integer"
      +              },
      +              "max_concurrent_runs": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "max_concurrent_runs",
      +              "max_agents",
      +              "max_active_workflows",
      +              "disk_gb"
      +            ],
      +            "type": [
      +              "null",
      +              "object"
      +            ]
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "offer": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "discount_code": {
      +                "type": "string"
      +              },
      +              "first_period_price_micro_usd": {
      +                "type": "integer"
      +              },
      +              "message": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "discount_code",
      +              "first_period_price_micro_usd",
      +              "message"
      +            ],
      +            "type": [
      +              "null",
      +              "object"
      +            ]
      +          },
      +          "plan": {
      +            "type": "string"
      +          },
      +          "url": {
      +            "type": "string"
      +          },
      +          "usd_cents_per_month": {
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "limit",
      +    "plan",
      +    "message",
      +    "remedies"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • addedOutput schema / properties / recent_runs / items / properties / gross_micro_usd
      Added value: +{
      +  "description": "Gross consumption before any refund.",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / refund_reason
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / refund_withheld_reason
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / refunded_micro_usd
      Added value: +{
      +  "description": "The refund reported once for this run.",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / recent_runs / items / properties / usage_by_role
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Gross consumption by role; credits sum to gross_micro_usd and refunds appear only in refunded_micro_usd.",
      +  "properties": {
      +    "advisor": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    },
      +    "executor": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    },
      +    "reviewer": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "calls": {
      +          "type": "integer"
      +        },
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "calls"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "executor",
      +    "advisor",
      +    "reviewer"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
    • changedOutput schema / properties / recent_runs / items / required
      Previous value: -[
      -  "id",
      -  "agent_id",
      -  "thread_id",
      -  "session_id",
      -  "status",
      -  "origin",
      -  "started_at",
      -  "credits",
      -  "tokens",
      -  "tool_progress"
      -]New value: +[
      +  "id",
      +  "agent_id",
      +  "thread_id",
      +  "session_id",
      +  "status",
      +  "origin",
      +  "started_at",
      +  "credits",
      +  "tokens",
      +  "advisor",
      +  "tool_progress"
      +]
    • changedOutput schema / required
      Previous value: -[
      -  "totals",
      -  "by_kind",
      -  "tools",
      -  "agents",
      -  "workflows",
      -  "workflow_executions",
      -  "recent_runs"
      -]New value: +[
      +  "totals",
      +  "by_role",
      +  "by_kind",
      +  "tools",
      +  "agents",
      +  "workflows",
      +  "workflow_executions",
      +  "recent_runs"
      +]
  2. Changed1 schema field changedv0.16.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "agents": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "agent_id": {
      +            "type": "string"
      +          },
      +          "backend": {
      +            "type": "string"
      +          },
      +          "breakdown": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "credits": {
      +                  "type": "integer"
      +                },
      +                "events": {
      +                  "type": "integer"
      +                },
      +                "kind": {
      +                  "type": "string"
      +                },
      +                "name": {
      +                  "type": "string"
      +                },
      +                "tokens": {
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "events",
      +                "tokens",
      +                "credits"
      +              ],
      +              "type": "object"
      +            },
      +            "type": [
      +              "null",
      +              "array"
      +            ]
      +          },
      +          "credits": {
      +            "type": "integer"
      +          },
      +          "events": {
      +            "type": "integer"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "tokens": {
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "agent_id",
      +          "name",
      +          "backend",
      +          "credits",
      +          "tokens",
      +          "events"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "by_kind": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "credits": {
      +            "type": "integer"
      +          },
      +          "events": {
      +            "type": "integer"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "tokens": {
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "credits",
      +          "tokens",
      +          "events"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "recent_runs": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "agent_id": {
      +            "description": "The agent that ran it.",
      +            "type": "string"
      +          },
      +          "cause": {
      +            "type": "string"
      +          },
      +          "command_error": {
      +            "type": "string"
      +          },
      +          "command_state": {
      +            "type": "string"
      +          },
      +          "continuation_run_id": {
      +            "type": "string"
      +          },
      +          "credits": {
      +            "type": [
      +              "null",
      +              "integer"
      +            ]
      +          },
      +          "ended_at": {
      +            "type": [
      +              "null",
      +              "string"
      +            ]
      +          },
      +          "error": {
      +            "additionalProperties": false,
      +            "description": "Why a terminal error or cancelled run failed, and what to do about it. Absent for a run that is still going or that finished normally.",
      +            "properties": {
      +              "class": {
      +                "description": "The failure class: the run's terminal cause, or \"unknown\" when none was recorded.",
      +                "type": "string"
      +              },
      +              "message": {
      +                "description": "What happened, and whether the work was charged.",
      +                "type": "string"
      +              },
      +              "next_step": {
      +                "description": "What to do about it.",
      +                "type": "string"
      +              },
      +              "retryable": {
      +                "description": "Whether sending the same message again could plausibly succeed.",
      +                "type": "boolean"
      +              }
      +            },
      +            "required": [
      +              "class",
      +              "message",
      +              "retryable",
      +              "next_step"
      +            ],
      +            "type": [
      +              "null",
      +              "object"
      +            ]
      +          },
      +          "id": {
      +            "description": "The run's public identifier; pass it to get_run_result as run_id.",
      +            "type": "string"
      +          },
      +          "input_expired": {
      +            "description": "True when this run is parked on a question its session has moved past: a later run in the same conversation has completed, so answering it would resume a superseded turn. Do not answer it; start a new run instead.",
      +            "type": "boolean"
      +          },
      +          "input_status": {
      +            "type": "string"
      +          },
      +          "input_updated_at": {
      +            "type": [
      +              "null",
      +              "string"
      +            ]
      +          },
      +          "last_heartbeat_at": {
      +            "type": [
      +              "null",
      +              "string"
      +            ]
      +          },
      +          "origin": {
      +            "description": "What started this run: user, schedule, email, background, agent or agent_result.",
      +            "type": "string"
      +          },
      +          "parent_run_id": {
      +            "type": "string"
      +          },
      +          "resume_run_id": {
      +            "type": "string"
      +          },
      +          "resume_status": {
      +            "type": "string"
      +          },
      +          "retryable": {
      +            "type": "boolean"
      +          },
      +          "session_id": {
      +            "description": "The conversation this run belongs to; pass it to invoke_agent as session_id to continue it. Identical to thread_id.",
      +            "type": "string"
      +          },
      +          "started_at": {
      +            "type": "string"
      +          },
      +          "status": {
      +            "description": "The run's status: queued, running, awaiting_input, completed, error or cancelled.",
      +            "type": "string"
      +          },
      +          "stop_reason": {
      +            "type": "string"
      +          },
      +          "thread_id": {
      +            "description": "The conversation this run belongs to. Identical to session_id.",
      +            "type": "string"
      +          },
      +          "tokens": {
      +            "type": [
      +              "null",
      +              "integer"
      +            ]
      +          },
      +          "tool_progress": {
      +            "additionalProperties": false,
      +            "description": "Durable tool execution progress, from the same telemetry get_run_result reads. Null for a run with no telemetry, and for a terminal run, which has no call in flight to report.",
      +            "properties": {
      +              "active_tools": {
      +                "items": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "started_at": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "id",
      +                    "name",
      +                    "started_at"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": [
      +                  "null",
      +                  "array"
      +                ]
      +              },
      +              "completed_count": {
      +                "type": "integer"
      +              },
      +              "last_completed_at": {
      +                "type": [
      +                  "null",
      +                  "string"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "active_tools",
      +              "completed_count"
      +            ],
      +            "type": [
      +              "null",
      +              "object"
      +            ]
      +          },
      +          "upstream_status": {
      +            "description": "The model provider's HTTP status when this run died on an upstream fault; absent otherwise.",
      +            "type": "integer"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "agent_id",
      +          "thread_id",
      +          "session_id",
      +          "status",
      +          "origin",
      +          "started_at",
      +          "credits",
      +          "tokens",
      +          "tool_progress"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "tools": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "calls": {
      +            "type": "integer"
      +          },
      +          "credits": {
      +            "type": "integer"
      +          },
      +          "free_calls": {
      +            "type": "integer"
      +          },
      +          "tool": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "calls",
      +          "free_calls",
      +          "credits"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "totals": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "credits": {
      +          "type": "integer"
      +        },
      +        "runs": {
      +          "type": "integer"
      +        },
      +        "tokens": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "credits",
      +        "tokens",
      +        "runs"
      +      ],
      +      "type": "object"
      +    },
      +    "workflow_executions": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "created_at": {
      +            "type": "string"
      +          },
      +          "credits": {
      +            "type": "integer"
      +          },
      +          "duration_ms": {
      +            "type": "integer"
      +          },
      +          "ended_at": {
      +            "type": [
      +              "null",
      +              "string"
      +            ]
      +          },
      +          "fault": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "status": {
      +            "type": "string"
      +          },
      +          "trigger_source": {
      +            "type": "string"
      +          },
      +          "workflow_id": {
      +            "type": "string"
      +          },
      +          "workflow_name": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "workflow_id",
      +          "workflow_name",
      +          "status",
      +          "trigger_source",
      +          "duration_ms",
      +          "credits",
      +          "created_at"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    },
      +    "workflows": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "billed_runs": {
      +            "type": "integer"
      +          },
      +          "credits": {
      +            "type": "integer"
      +          },
      +          "exec_credits": {
      +            "type": "integer"
      +          },
      +          "model_credits": {
      +            "type": "integer"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "tokens": {
      +            "type": "integer"
      +          },
      +          "workflow_id": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "workflow_id",
      +          "name",
      +          "billed_runs",
      +          "exec_credits",
      +          "model_credits",
      +          "credits",
      +          "tokens"
      +        ],
      +        "type": "object"
      +      },
      +      "type": [
      +        "null",
      +        "array"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "totals",
      +    "by_kind",
      +    "tools",
      +    "agents",
      +    "workflows",
      +    "workflow_executions",
      +    "recent_runs"
      +  ],
      +  "type": "object"
      +}
  3. Addedv0.7.0
  4. Removedv0.3.0
  5. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, and the description adds useful behavior beyond that: the data is scoped to the authenticated account, aggregated as a rollup, and includes spend dimensions plus recent runs. It does not contradict the annotations.

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

Conciseness5/5

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

Two compact sentences with no filler. The core purpose and included breakdown are front-loaded, and the sibling distinction is delivered in the second sentence without redundancy.

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?

For a zero-parameter, read-only tool with an output schema, the description provides all essential context: account scope, aggregation type, spend dimensions, and when to choose a different tool. Nothing material 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?

The tool has zero parameters, so there is nothing for the description to clarify. Per the rubric, a zero-parameter tool gets a baseline of 4; the description correctly focuses on the output semantics instead.

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 uses a specific verb ('Get') with a clear resource: the authenticated account's usage rollup. It further specifies the breakdown ('US-dollar spend by role, meter, and agent') and 'recent runs', making its purpose distinct from the sibling get_credits.

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

Usage Guidelines5/5

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

It explicitly states when to use this tool: 'Use this to answer where the money went.' It also names the alternative for a different need: 'for the current balance use get_credits.' This is clear routing with no inference required.

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