Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_update_stock

Modify inventory item details in POHODA accounting software. Update product names, prices, units, VAT rates, and notes to maintain accurate stock records.

Instructions

Update an existing stock/inventory item in POHODA

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoStock item ID to update
codeNoStock code to identify item (alternative to id)
nameNoNew name
unitNoNew unit
purchasingPriceNoNew purchasing price
sellingPriceNoNew selling price
rateVATNoNew VAT rate
noteNoNew note

Implementation Reference

  • Handler and registration for the 'pohoda_update_stock' tool. It constructs an XML request using 'buildImportDoc' to send an update command to the Pohoda client based on provided stock item parameters.
    server.tool(
      "pohoda_update_stock",
      "Update an existing stock/inventory item in POHODA",
      {
        id: z.number().optional().describe("Stock item ID to update"),
        code: z.string().optional().describe("Stock code to identify item (alternative to id)"),
        name: z.string().optional().describe("New name"),
        unit: z.string().optional().describe("New unit"),
        purchasingPrice: z.number().optional().describe("New purchasing price"),
        sellingPrice: z.number().optional().describe("New selling price"),
        rateVAT: z.enum(["none", "low", "high"]).optional().describe("New VAT rate"),
        note: z.string().optional().describe("New note"),
      },
      async (params) => {
        try {
          if (!params.id && !params.code) return err("Either id or code is required to identify the stock item.");
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const stk = item.ele(NS.stk, "stk:stock").att("version", "2.0");
            const act = stk.ele(NS.stk, "stk:actionType").ele(NS.stk, "stk:update");
            const ftr = act.ele(NS.ftr, "ftr:filter");
            if (params.id != null) ftr.ele(NS.ftr, "ftr:id").txt(String(params.id));
            else if (params.code) ftr.ele(NS.ftr, "ftr:code").txt(params.code);
            const hdr = stk.ele(NS.stk, "stk:stockHeader");
            if (params.name) hdr.ele(NS.stk, "stk:name").txt(params.name);
            if (params.unit) hdr.ele(NS.stk, "stk:unit").txt(params.unit);
            if (params.purchasingPrice != null) hdr.ele(NS.stk, "stk:purchasingPrice").txt(String(params.purchasingPrice));
            if (params.sellingPrice != null) hdr.ele(NS.stk, "stk:sellingPrice").txt(String(params.sellingPrice));
            if (params.rateVAT) hdr.ele(NS.stk, "stk:rateVAT").txt(params.rateVAT);
            if (params.note) hdr.ele(NS.stk, "stk:note").txt(params.note);
          });
          const resp = parseResponse(await client.sendXml(xml));
          const result = extractImportResult(resp);
          return result.success ? ok(`Stock item updated. ${result.message}`) : err(`Failed: ${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