Skip to main content
Glama
MSPbotsAI

openai-workspace-mcp

by MSPbotsAI

openai_get_usage

Retrieve OpenAI API usage metrics in time-bucketed intervals, with filters for category, project, user, API key, and model to analyze consumption trends.

Instructions

Query time-bucketed API usage for the organization.

    `limit` caps the number of time buckets returned, with different
    defaults/maximums per bucket_width: 1d -> default 7, max 31; 1h ->
    default 24, max 168; 1m -> default 60, max 1440.

    Args:
        category: Which usage type to query — one of: completions,
            embeddings, moderations, images, audio_speeches,
            audio_transcriptions, vector_stores, code_interpreter_sessions,
            file_search_calls, web_search_calls.
        start_time: Start of the query range, inclusive (Unix seconds).
        end_time: End of the query range, exclusive (Unix seconds).
        bucket_width: Time bucket size — `1m`, `1h`, or `1d` (default `1d`).
        group_by: Fields to group by, e.g. project_id, user_id, api_key_id,
            model, batch, service_tier (supported fields vary by category).
        project_ids: Only include usage for these projects.
        user_ids: Only include usage for these users.
        api_key_ids: Only include usage for these API keys.
        models: Only include usage for these models.
        limit: Number of time buckets to return.
        page: Pagination cursor from a previous response's `next_page`.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
limitNo
modelsNo
categoryYes
end_timeNo
group_byNo
user_idsNo
start_timeYes
api_key_idsNo
project_idsNo
bucket_widthNo1d

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses useful behavioral details such as bucket_width-specific defaults/maximums and pagination via 'page'. However, it does not explicitly state that the operation is read-only, mention authentication requirements, or note any rate limits, leaving some transparency gaps.

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 description is well-structured: a one-sentence summary followed by a parameter list. While lengthy, it is necessary for 11 parameters and every line adds value. It is front-loaded and organized, though slightly more verbose than strictly necessary.

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 tool with 11 parameters and zero schema descriptions, the description provides comprehensive semantics including defaults, enum values, pagination, and filter behavior. The presence of an output schema covers return-value documentation, making the description complete for a complex query tool.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates fully by documenting every parameter with types, allowed values (e.g., category enum, bucket_width options), semantics (start_time inclusive, end_time exclusive), and defaults (limit per bucket_width). This is exemplary parameter documentation.

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 opens with 'Query time-bucketed API usage for the organization,' which specifies a clear verb (query), resource (API usage), and scope (organization). This clearly distinguishes it from sibling tools that focus on projects, users, invites, service accounts, and costs.

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 is implied by the tool's name and description: it is for querying organization API usage. However, there is no explicit guidance on when to use it versus alternatives like openai_get_costs, nor any exclusions or prerequisites. This is a clear context but lacks explicit differentiation.

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/MSPbotsAI/openai-workspace-mcp-'

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