Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

billing_get_org_usage

Retrieve usage details for a Cloud Foundry organization by specifying the organization ID and month.

Instructions

Get usage for a Cloud Foundry organization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNo
org_idYes
monthYes

Implementation Reference

  • Registration of the 'billing_get_org_usage' tool via server.tool(). Defines the handler inline with the schema for account_id, org_id, and month parameters. Constructs the API URL using the BILLING base endpoint.
    server.tool("billing_get_org_usage", "Get usage for a Cloud Foundry organization", {
      account_id: z.string().optional(), org_id: z.string(), month: z.string(),
    }, async (p) => safeTool(async () => {
      const acctId = p.account_id || await client.getAuth().getAccountId();
      return client.get(`${base}/accounts/${acctId}/organizations/${p.org_id}/usage/${p.month}`);
    }));
  • The handler function for billing_get_org_usage. Resolves the account ID (from optional param or auth manager), then calls client.get() on the billing API path: /accounts/{acctId}/organizations/{org_id}/usage/{month}. Calls safeTool to wrap the async operation with error handling.
    }, async (p) => safeTool(async () => {
      const acctId = p.account_id || await client.getAuth().getAccountId();
      return client.get(`${base}/accounts/${acctId}/organizations/${p.org_id}/usage/${p.month}`);
    }));
  • Input schema for billing_get_org_usage defining three parameters: account_id (optional string), org_id (required string), and month (required string, format YYYY-MM).
    account_id: z.string().optional(), org_id: z.string(), month: z.string(),
  • The safeTool utility wraps async handler functions to catch errors and return proper MCP success/error content blocks.
    export async function safeTool<T>(fn: () => Promise<T>): Promise<ReturnType<typeof successContent> | ReturnType<typeof errorContent>> {
      try {
  • The BILLING endpoint constant: 'https://billing.cloud.ibm.com/v4' which is used as the base URL for the billing_get_org_usage API call.
    BILLING: "https://billing.cloud.ibm.com/v4",
Behavior1/5

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

With no annotations, the description should disclose behavioral traits like idempotency or data limits, but it offers none. The tool name suggests a read operation, but no additional context is given.

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

Conciseness2/5

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

The single-sentence description is under-specified. It is concise but lacks essential details, making it insufficient rather than effectively minimal.

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

Completeness1/5

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

Without an output schema or parameter descriptions, the description is highly incomplete. The agent cannot infer response format or parameter usage, severely limiting correct invocation.

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

Parameters1/5

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

Schema coverage is 0%, and the description adds no meaning to the three parameters (account_id, org_id, month). The agent receives no guidance on their format, constraints, or purpose.

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

Purpose3/5

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

The description states the tool gets usage for a Cloud Foundry organization, but it does not differentiate from sibling billing tools like billing_get_account_usage or billing_get_resource_usage, leaving ambiguity about the specific usage scope.

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?

No guidance is provided on when to use this tool versus alternatives (e.g., billing_get_account_summary). The description lacks context for selecting this tool over siblings.

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/ahmedselimmansor-ctrl/IBM_cloud_MCP_SERVER'

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