Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_delete_invoice

Remove invoices from POHODA accounting software by specifying the invoice ID. This tool helps maintain accurate financial records by deleting specific invoices when needed.

Instructions

Delete an invoice from POHODA by ID. Requires the invoice ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID to delete (required)

Implementation Reference

  • The implementation of the `pohoda_delete_invoice` tool. It constructs an XML request to delete an invoice by its ID and handles the response.
    server.tool(
      "pohoda_delete_invoice",
      "Delete an invoice from POHODA by ID. Requires the invoice ID.",
      {
        id: z.number().describe("Invoice ID to delete (required)"),
      },
      async (params) => {
        try {
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const inv = item.ele(NS.inv, "inv:invoice").att("version", "2.0");
            const actionType = inv.ele(NS.inv, "inv:actionType");
            const del = actionType.ele(NS.inv, "inv:delete");
            const filter = del.ele(NS.ftr, "ftr:filter");
            filter.ele(NS.ftr, "ftr:id").txt(String(params.id));
          });
          const response = await client.sendXml(xml);
          const result = extractImportResult(parseResponse(response));
          return result.success ? ok(`Invoice deleted successfully. ${result.message}`) : err(result.message);
        } catch (e) {
          return err((e as Error).message);
        }
      }
    );

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/hlebtkachenko/pohoda-mcp'

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