Skip to main content
Glama
generateInvoicePdf.ts1.12 kB
import { z } from 'zod'; import type { McpTool } from '../types.js'; import { validateInput } from '../../utils/validation.js'; const generateInvoicePdfSchema = z.object({ id: z.number().positive(), second_copy: z.boolean().default(false), }); export const generateInvoicePdfTool: McpTool = { name: 'invoice_generate_pdf', description: 'Generate a PDF for an invoice', inputSchema: { type: 'object', required: ['id'], properties: { id: { type: 'number', description: 'Invoice ID', }, second_copy: { type: 'boolean', description: 'Generate a second copy of the document (default: false)', }, }, }, handler: async (args, server) => { const { id, second_copy } = validateInput(generateInvoicePdfSchema, args, 'generate invoice PDF'); const result = await server.invoicesEndpoint.generatePdf(id, second_copy); return { success: true, invoice_id: id, pdf_url: result.output.pdfUrl, is_second_copy: second_copy, message: `PDF generated successfully for invoice ${id}`, }; }, };

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/andreagroferreira/invoiceexpress-mcp'

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