Skip to main content
Glama
ahmedselimmansor-ctrl

IBM Cloud MCP Server

billing_get_account_summary

Retrieve a billing summary for your IBM Cloud account for a specified month to track costs.

Instructions

Get account billing summary for a given month

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNo
monthYesBilling month (YYYY-MM)

Implementation Reference

  • The tool handler for 'billing_get_account_summary'. It registers an MCP tool that takes optional account_id and required month (YYYY-MM), resolves the account ID (from param or auth), then calls the IBM Cloud Billing API at GET /v4/accounts/{id}/summary/{month} via the client.
    server.tool("billing_get_account_summary", "Get account billing summary for a given month", {
      account_id: z.string().optional(), month: z.string().describe("Billing month (YYYY-MM)"),
    }, async (p) => safeTool(async () => {
      const acctId = p.account_id || await client.getAuth().getAccountId();
      return client.get(`${base}/accounts/${acctId}/summary/${p.month}`);
    }));
  • Input schema for 'billing_get_account_summary': account_id (optional string) and month (string with YYYY-MM description).
    server.tool("billing_get_account_summary", "Get account billing summary for a given month", {
      account_id: z.string().optional(), month: z.string().describe("Billing month (YYYY-MM)"),
    }, async (p) => safeTool(async () => {
      const acctId = p.account_id || await client.getAuth().getAccountId();
      return client.get(`${base}/accounts/${acctId}/summary/${p.month}`);
    }));
  • The IBM_ENDPOINTS.BILLING constant that provides the base URL (https://billing.cloud.ibm.com/v4) used in the tool's API call.
    BILLING: "https://billing.cloud.ibm.com/v4",
  • src/server.ts:17-17 (registration)
    Import of registerBillingTools from the billing module, and call on line 80 to register all billing tools (including billing_get_account_summary) into the MCP server.
    import { registerBillingTools } from "./tools/billing/index.js";
  • The safeTool helper that wraps the tool handler, catching errors and returning success/error MCP responses.
    export async function safeTool<T>(fn: () => Promise<T>): Promise<ReturnType<typeof successContent> | ReturnType<typeof errorContent>> {
      try {
        const result = await fn();
        return successContent(result);
      } catch (error) {
        return errorContent(error);
      }
    }
Behavior2/5

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

No annotations provided; description fails to disclose behavioral traits such as return format, side effects, or whether account_id is optional. Minimal info beyond purpose.

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?

Single sentence is concise and front-loaded, but potentially too minimal; could include more detail without verbosity.

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

Completeness2/5

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

Tool lacks output schema and annotations; description does not explain what a billing summary contains, how optional parameters affect results, or any error conditions.

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

Parameters2/5

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

Schema coverage is 50%; only month is described. Description echoes 'given month' but adds no additional semantics for account_id or parameter constraints beyond schema.

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?

Description clearly indicates 'get' verb and 'account billing summary' resource, distinguishing it from billing_get_account_usage (usage vs summary) and other sibling billing tools.

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 on when to use this tool versus siblings like billing_get_account_usage or billing_get_org_usage. Lacks context for appropriate usage.

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