Skip to main content
Glama

siigo_delete_invoice

Remove invoices from the Siigo accounting system by specifying the invoice ID. This tool helps maintain accurate financial records by deleting unwanted or incorrect invoice entries.

Instructions

Delete an invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID

Implementation Reference

  • src/index.ts:409-419 (registration)
    Registration of the 'siigo_delete_invoice' tool in the MCP server's tool list, including description and input schema requiring an invoice ID.
    { name: 'siigo_delete_invoice', description: 'Delete an invoice', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Invoice ID' }, }, required: ['id'], }, },
  • MCP server handler function for siigo_delete_invoice tool. Extracts the invoice ID from arguments and calls SiigoClient.deleteInvoice, then formats the result as MCP content response.
    private async handleDeleteInvoice(args: any) { const result = await this.siigoClient.deleteInvoice(args.id); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], };
  • Core handler in SiigoClient that performs the actual DELETE HTTP request to the Siigo API endpoint `/v1/invoices/${id}` using the generic makeRequest method.
    async deleteInvoice(id: string): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('DELETE', `/v1/invoices/${id}`); }
  • Generic helper method in SiigoClient for making authenticated HTTP requests to Siigo API, used by deleteInvoice and all other endpoints.
    private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> { await this.authenticate(); try { const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({ method, url: endpoint, data, params, }); return response.data; } catch (error: any) { if (error.response?.data) { return error.response.data; } throw new Error(`API request failed: ${error.message}`); } }
  • src/index.ts:91-92 (registration)
    Switch case in MCP CallToolRequest handler that dispatches 'siigo_delete_invoice' calls to the specific handleDeleteInvoice method.
    case 'siigo_delete_invoice': return await this.handleDeleteInvoice(args);

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/jdlar1/siigo-mcp'

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