Skip to main content
Glama
collapseindex

CI-1T Prediction Stability Engine

get_invoices

Retrieve billing history and Stripe invoices, including amounts, credits, dates, and statuses. Supports pagination with a cursor for navigating results.

Instructions

Get billing history (Stripe invoices). Response: { invoices: [{ amount, credits, date, status }], has_more, cursor }. Pass cursor to paginate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor (payment intent ID) for next page

Implementation Reference

  • src/index.ts:805-821 (registration)
    The 'get_invoices' tool is registered using server.tool() with Zod schema for the optional 'cursor' parameter.
    server.tool(
      "get_invoices",
      "Get billing history (Stripe invoices). Response: { invoices: [{ amount, credits, date, status }], has_more, cursor }. Pass cursor to paginate.",
      {
        cursor: z.string().optional().describe("Pagination cursor (payment intent ID) for next page"),
      },
      async ({ cursor }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const params = cursor ? `?cursor=${encodeURIComponent(cursor)}` : "";
        const result = await apiFetch(`/api/stripe-invoices${params}`, {
          method: "GET",
          headers: apiKeyHeaders(),
        });
        return formatResult(result);
      }
    );
  • The handler function calls requireApiKey() to guard authentication, then fetches GET /api/stripe-invoices with an optional pagination cursor parameter.
      async ({ cursor }) => {
        const guard = requireApiKey();
        if (guard) return guard;
        const params = cursor ? `?cursor=${encodeURIComponent(cursor)}` : "";
        const result = await apiFetch(`/api/stripe-invoices${params}`, {
          method: "GET",
          headers: apiKeyHeaders(),
        });
        return formatResult(result);
      }
    );
  • Zod schema for get_invoices: accepts an optional 'cursor' string parameter for pagination of billing history.
    {
      cursor: z.string().optional().describe("Pagination cursor (payment intent ID) for next page"),
    },
Behavior4/5

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

No annotations provided, so description bears full burden. It discloses the response structure (invoices array with fields, has_more, cursor) and pagination mechanism, which is sufficient transparency for a read operation.

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 brief sentences, no wasted words, front-loaded with purpose followed by response format and usage guidance.

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 simple paginated list tool with one optional parameter and no output schema, the description provides a clear response structure and usage guidance, fully covering the needed context.

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

Parameters3/5

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

Schema description coverage is 100% with the cursor parameter already described. The description reinforces its role in pagination ('Pass cursor to paginate') but adds no new semantic details beyond the 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?

The description clearly states 'Get billing history (Stripe invoices)' with a specific verb and resource. It distinguishes from sibling tools like 'alert_check' or 'convert_scores' by focusing on invoices.

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

Usage Guidelines4/5

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

The description explicitly mentions pagination usage: 'Pass cursor to paginate'. It does not explicitly state when to avoid or alternative tools, but the purpose is clear enough.

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/collapseindex/ci-1t-mcp'

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