Skip to main content
Glama
visaacceptance

Visa Acceptance

list_invoices

Get paginated invoices from Visa Acceptance with optional status filter. Control results using offset and limit parameters.

Instructions

This tool will list invoices from Visa Acceptance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetYesPagination offset (required)
limitYesPagination limit (required)
statusNoFilter by status (optional)

Implementation Reference

  • The main handler function for the list_invoices tool. Uses CyberSource InvoicesApi.getAllInvoices to fetch invoices with offset, limit, and optional status filter. Results are masked via maskInvoicesCustomerInfo.
    export const listInvoices = async (
      visaClient: any,
      context: VisaContext,
      params: z.infer<ReturnType<typeof listInvoicesParameters>>
    ) => {
      try {
        const invoiceApiInstance = new cybersourceRestApi.InvoicesApi(visaClient.configuration, visaClient.visaApiClient);
        const opts: { status?: string } = {};
        if (params.status != null && params.status !== '') {
          opts.status = params.status;
        }
        console.log('Sending request with params:', JSON.stringify({ offset: params.offset, limit: params.limit, opts }));
        const result = await new Promise((resolve, reject) => {
          invoiceApiInstance.getAllInvoices(
            params.offset,
            params.limit,
            opts,
            (error: any, data: any, response: any) => {
              if (error) {
                console.error('Error in listInvoices:', JSON.stringify(error));
                reject(error);
              } else {
                console.log('Response from getAllInvoices:', JSON.stringify(response));
                resolve(data);
              }
            }
          );
        });
        
        const typedResult = result as any;
        let maskedResult = maskInvoicesCustomerInfo(typedResult);
        return maskedResult;
      } catch (error) {
        console.error('Failed to list invoices:', error);
        return 'Failed to list invoices';
      }
    };
  • Parameter schema for list_invoices using Zod: offset (number, required), limit (number, required), status (string, optional).
    export const listInvoicesParameters = (
      context: VisaContext = {} as VisaContext
    ) => {
      return z.object({
        offset: z.number().describe('Pagination offset (required)'),
        limit: z.number().describe('Pagination limit (required)'),
        status: z.string().optional().describe('Filter by status (optional)')
      });
    };
  • Tool registration object that defines method 'list_invoices', name, description, parameters, actions (invoices:read), and the execute handler.
    const tool = (context: VisaContext): Tool => ({
      method: 'list_invoices',
      name: 'List Invoices',
      description: listInvoicesPrompt(context),
      parameters: listInvoicesParameters(context),
      actions: {
        invoices: {
          read: true,
        },
      },
      execute: listInvoices,
    });
    
    export default tool;
  • The createTools function that aggregates all tools including listInvoicesToolModule into an array for registration.
    export function createTools(context: VisaContext): Tool[] {
      return [
        createInvoiceToolModule(context),
        updateInvoiceToolModule(context),
        getInvoiceToolModule(context),
        listInvoicesToolModule(context),
        sendInvoiceToolModule(context),
        cancelInvoiceToolModule(context),
        createPaymentLinkToolModule(context),
        updatePaymentLinkToolModule(context),
        getPaymentLinkToolModule(context),
        listPaymentLinkToolModule(context)
      ];
    }
  • Helper that masks customer PII (name, email) in the invoices array returned by the list_invoices handler.
    export const maskInvoicesCustomerInfo = (
      invoices: any[],
      context?: Context
    ): any[] => {
      try {
        if (!invoices || !Array.isArray(invoices)) return invoices;
        
        return invoices.map(invoice => maskInvoiceCustomerInfo(invoice, context));
      } catch (error) {
        return [];
      }
    };
Behavior2/5

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

No annotations provided. The description only mentions listing invoices without disclosing behavioral traits such as pagination behavior, ordering, or whether it is read-only. For a list tool, basic read-only hint would help.

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

Conciseness3/5

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

The description is a single sentence but lacks front-loading of key information. It is not overly verbose, but it could be more informative without increasing length.

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?

The tool is simple but has no output schema. The description does not indicate what the return format is (e.g., list of invoice objects). Given the absence of annotations and output schema, more context would be beneficial.

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%, so the schema already documents all three parameters. The description adds no additional meaning beyond the schema, resulting in a baseline score of 3.

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 'list invoices from Visa Acceptance', specifying the action (list) and resource (invoices) and a source. It distinguishes from sibling tools like cancel_invoice or create_invoice.

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 alternatives such as get_invoice for a single invoice or list_payment_links for payment links. The description lacks context for selection.

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/visaacceptance/agent-toolkit'

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