Skip to main content
Glama

list_external_invoices

Retrieve a paginated list of external invoices for a specific integration. Use integration ID, optional includes, and page parameters.

Instructions

List external invoices for an integration. GET /integrations/{integrationId}/external-invoices. Optional: include, itemPerPage, pageNo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
integrationIdYesCompany integration ID (required)
includeNoComma-separated attributes to include
itemPerPageNoItems per page
pageNoNoPage number

Implementation Reference

  • Tool handler that validates args with Zod schema and delegates to integrationService.listExternalInvoices.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => e.message).join("; "));
      }
      const { integrationId, include, itemPerPage, pageNo } = parsed.data;
      return handleToolCall(() =>
        integrationService.listExternalInvoices(client, integrationId, {
          include,
          itemPerPage,
          pageNo,
        })
      );
    }
  • Zod validation schema for list_external_invoices inputs.
    const schema = z.object({
      integrationId: z.string().min(1, "integrationId is required"),
      include: z.string().optional(),
      itemPerPage: z.number().int().min(1).optional(),
      pageNo: z.number().int().min(1).optional(),
    });
  • Exports the Tool object with definition and handler, imported in integrations/index.ts and registered via registerIntegrationTools().
    export const listExternalInvoicesTool: Tool = {
      definition,
      handler,
    };
  • Registration point in the integrations tool array; also re-exported in src/tools/index.ts.
    export function registerIntegrationTools(): Tool[] {
      return [
        listIntegrationsTool,
        getIntegrationConfigTool,
        getIntegrationByKeyTool,
        listIntegrationsByKeyTool,
        listExternalInvoicesTool,
        listExternalProductsTool,
        getExternalProductTool,
        listOrderStatusesTool,
      ];
    }
  • Service function that makes the actual GET request to /integrations/{integrationId}/external-invoices with query params.
    /** GET /integrations/{integrationId}/external-invoices */
    export async function listExternalInvoices(
      client: Client,
      integrationId: string,
      params?: ListExternalInvoicesParams
    ): Promise<unknown> {
      const search = new URLSearchParams();
      if (params?.include) search.append("include", params.include);
      if (params?.itemPerPage != null) search.append("itemPerPage", String(params.itemPerPage));
      if (params?.pageNo != null) search.append("pageNo", String(params.pageNo));
      const q = search.toString();
      return client.get<unknown>(`/integrations/${integrationId}/external-invoices${q ? `?${q}` : ""}`);
    }
Behavior2/5

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

With no annotations, the description carries full burden. It only mentions optional parameters but does not disclose pagination behavior (defaults, limits, tokens), authentication needs, or response structure. For a list tool, missing these details weakens transparency.

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?

Two sentences, no wasted words. The first sentence states purpose, the second adds endpoint and params. Efficient, though could benefit from structuring guidelines.

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

Completeness3/5

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

For a simple list tool with 4 parameters and no output schema, the description is partially adequate. It provides the endpoint and params, but lacks behavioral context like pagination behavior and return format, which would complete the picture.

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 coverage is 100%, so the schema already explains parameters. The description only restates optional params without adding new semantic meaning, meeting the baseline.

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 it lists external invoices for an integration, with a specific verb and resource. The HTTP path is provided, and it distinguishes from sibling tools like list_invoices (which lists all invoices) and get_subscription_external_invoices (which is per subscription).

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 explicit guidance on when to use this tool vs alternatives. Sibling tools include list_invoices and get_subscription_external_invoices, but the description does not differentiate or provide context.

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/rhinosaas/rebillia-mcp-server'

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