Skip to main content
Glama
visaacceptance

Visa Acceptance

send_invoice

Send invoices to customers through the Visa Acceptance platform. This tool processes invoice delivery using a required invoice ID for transaction completion.

Instructions

This tool will send an invoice to the customer from Visa Acceptance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYesInvoice ID (required)

Implementation Reference

  • The handler function that implements the core logic of the 'send_invoice' tool, sending the invoice via Cybersource REST API and masking customer info.
    export const sendInvoice = async (
      visaClient: any,
      context: VisaContext,
      params: z.infer<ReturnType<typeof sendInvoiceParameters>>
    ) => {
      try {
        const invoiceApiInstance = new cybersourceRestApi.InvoicesApi(visaClient.configuration, visaClient.visaApiClient);
        
        const result = await new Promise((resolve, reject) => {
          invoiceApiInstance.performSendAction(params.invoice_id, (error: any, data: any, response: any) => {
            if (error) {
              reject(error);
            } else {
              resolve({
                data,
                status: response['status']
              });
            }
          });
        });
        
        const maskedResult = maskInvoiceCustomerInfo(result);
        return maskedResult;
      } catch (error) {
        return 'Failed to send invoice';
      }
    };
  • Zod schema defining the input parameters for the send_invoice tool.
    export const sendInvoiceParameters = (
      context: VisaContext = {} as VisaContext
    ) => {
      return z.object({
        invoice_id: z.string().describe('Invoice ID (required)')
      });
    };
  • Definition of the tool object/module for 'send_invoice', which is exported as default and includes method name, description, parameters, and execute handler reference.
    const tool = (context: VisaContext): Tool => ({
      method: 'send_invoice',
      name: 'Send Invoice',
      description: sendInvoicePrompt(context),
      parameters: sendInvoiceParameters(context),
      actions: {
        invoices: {
          update: true,
        },
      },
      execute: sendInvoice,
    });
  • Registration of the send_invoice tool within the createTools function, which aggregates and returns all available tools including sendInvoiceToolModule(context).
    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 function generating the description/prompt for the send_invoice tool.
    export const sendInvoicePrompt = (context: VisaContext = {} as VisaContext) => `
    This tool will send an invoice to the customer from Visa Acceptance.
    `;
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the tool sends an invoice, implying a mutation action, but doesn't cover critical aspects like permissions required, whether it's idempotent, rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap in 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?

The description is a single, straightforward sentence with no wasted words, making it appropriately concise. It's front-loaded with the core action, though it could be slightly more informative without sacrificing brevity. Every part of the sentence contributes to understanding the tool's purpose.

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?

Given the complexity of a mutation tool (sending invoices), lack of annotations, no output schema, and incomplete behavioral context, the description is insufficient. It doesn't explain return values, error conditions, or integration details with 'Visa Acceptance,' leaving gaps that could hinder effective tool invocation by an AI agent.

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?

The input schema has 100% description coverage, with the 'invoice_id' parameter clearly documented as 'Invoice ID (required).' The description adds no additional meaning beyond this, such as format examples or context about the invoice source. With high schema coverage, the baseline score of 3 is appropriate as the schema handles the heavy lifting.

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 'will send an invoice to the customer from Visa Acceptance,' which provides a clear verb ('send') and resource ('invoice'). However, it doesn't distinguish this from sibling tools like 'create_invoice' or 'update_invoice,' leaving the specific action vague relative to alternatives. It's functional but lacks sibling differentiation.

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?

The description offers no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing invoice), exclusions, or comparisons to siblings like 'create_invoice' or 'get_invoice.' Without any context, users must infer usage from the tool name alone.

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