Skip to main content
Glama

get_invoice

Retrieve a specific invoice from the Visa Acceptance system using its unique ID to access payment details and transaction records.

Instructions

This tool will get a specific invoice from Visa Acceptance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID (required)

Implementation Reference

  • The handler function that executes the get_invoice tool logic. It uses the Cybersource InvoicesApi to fetch the invoice by ID, masks customer information, and returns the result or an error message.
    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: a required string 'id' for the invoice ID.
    export const getInvoiceParameters = ( context: VisaContext = {} as VisaContext ) => { return z.object({ id: z.string().describe('Invoice ID (required)') }); };
  • Tool object definition and default export for the get_invoice tool, specifying method name, description, parameters, actions, and handler reference.
    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;
  • Registration of the get_invoice tool (as getInvoiceToolModule(context)) into the central tools array via the createTools function.
    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) ]; }
  • Prompt providing the description text for the get_invoice tool.
    export const getInvoicePrompt = (context: VisaContext = {} as VisaContext) => ` This tool will get a specific invoice from Visa Acceptance. `;

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