Skip to main content
Glama

get_invoice

Retrieve a specific invoice from Visa Acceptance by providing the invoice ID to access detailed billing information.

Instructions

This tool will get a specific invoice from Visa Acceptance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID (required)

Implementation Reference

  • The core handler function that executes the 'get_invoice' tool logic: fetches the invoice by ID using Cybersource InvoicesApi, handles errors, masks sensitive customer information, and returns the result.
    export const getInvoice = async ( visaClient: any, context: VisaContext, params: z.infer<ReturnType<typeof getInvoiceParameters>> ) => { try { const invoiceApiInstance = new cybersourceRestApi.InvoicesApi(visaClient.configuration, visaClient.visaApiClient); const result = await new Promise((resolve, reject) => { invoiceApiInstance.getInvoice(params.id, (error: any, data: any) => { if (error) { reject(error); } else { resolve(data); } }); }); const maskedResult = maskInvoiceCustomerInfo(result); return maskedResult; } catch (error) { return 'Failed to get invoice'; } };
  • Zod schema defining the input parameters for the 'get_invoice' tool: requires an 'id' string (Invoice ID).
    export const getInvoiceParameters = ( context: VisaContext = {} as VisaContext ) => { return z.object({ id: z.string().describe('Invoice ID (required)') }); };
  • Defines and exports the tool registration object for 'get_invoice', including method name, description, parameters schema, actions permissions, and the execute handler reference. Imported and included in the master tools list.
    const tool = (context: VisaContext): Tool => ({ method: 'get_invoice', name: 'Get Invoice', description: getInvoicePrompt(context), parameters: getInvoiceParameters(context), actions: { invoices: { read: true, }, }, execute: getInvoice, }); export default tool;
  • Aggregates all tool modules including 'get_invoice' (via getInvoiceToolModule) into a list returned by createTools, used by MCP server toolkits 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) ];

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