Skip to main content
Glama
MSPbotsAI

openai-workspace-mcp

by MSPbotsAI

openai_get_costs

Query daily OpenAI API spend breakdown by project, API key, or line item. Specify a start time to get cost buckets, with optional grouping and filtering.

Instructions

Query the organization's daily spend breakdown.

    Args:
        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 — only `1d` is currently supported.
        group_by: Fields to group by — project_id, line_item, api_key_id.
        project_ids: Only include costs for these projects.
        api_key_ids: Only include costs for these API keys.
        limit: Number of buckets to return (1-180, default 7).
        page: Pagination cursor from a previous response's `next_page`.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
limitNo
end_timeNo
group_byNo
start_timeYes
api_key_idsNo
project_idsNo
bucket_widthNo1d

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It discloses that bucket_width only supports '1d', provides a limit range (1-180), explains pagination via next_page, and implies a read-only query operation. This is useful but does not mention authentication requirements or rate limits.

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?

The description is efficiently structured with a one-line purpose followed by a terse, informative parameter list. Every element adds value, and the critical information is front-loaded.

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?

The description covers all input parameters thoroughly, and with an output schema present, return values are already documented. The main gap is the lack of usage context relative to sibling tools like openai_get_usage, but overall it is sufficiently complete for an agent to invoke the 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?

The schema has 0% parameter description coverage, so the detailed Args block in the description fully compensates. It explains the meaning, formats, defaults, and constraints for all 8 parameters, including the allowed bucket_width value and pagination semantics.

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 clearly states it queries the organization's daily spend breakdown, which is a specific verb and resource. However, it does not explicitly contrast this with the sibling tool openai_get_usage, so it lacks explicit sibling differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as openai_get_usage. It merely states what the tool does, leaving usage context to be inferred from the tool name.

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