Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_create_stock

Add new inventory items to POHODA accounting software by specifying code, name, pricing, VAT rates, and stock details for accurate inventory management.

Instructions

Create a new stock/inventory item in POHODA

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesUnique stock code
nameYesStock item name
stockTypeNoStock type (default: card)
unitNoUnit of measure (e.g., ks, kg, m)
purchasingPriceNoPurchasing price
sellingPriceNoSelling price without VAT
sellingPriceVATNoSelling price with VAT
rateVATNoVAT rate
storeNoStore name
noteNoNote
descriptionNoExtended description
quantityNoInitial quantity

Implementation Reference

  • The implementation of the `pohoda_create_stock` tool handler, including schema definition and XML construction logic.
    server.tool(
      "pohoda_create_stock",
      "Create a new stock/inventory item in POHODA",
      {
        code: z.string().describe("Unique stock code"),
        name: z.string().describe("Stock item name"),
        stockType: z.enum(["card", "text", "service", "kit", "set"]).optional().describe("Stock type (default: card)"),
        unit: z.string().optional().describe("Unit of measure (e.g., ks, kg, m)"),
        purchasingPrice: z.number().optional().describe("Purchasing price"),
        sellingPrice: z.number().optional().describe("Selling price without VAT"),
        sellingPriceVAT: z.number().optional().describe("Selling price with VAT"),
        rateVAT: z.enum(["none", "low", "high"]).optional().describe("VAT rate"),
        store: z.string().optional().describe("Store name"),
        note: z.string().optional().describe("Note"),
        description: z.string().optional().describe("Extended description"),
        quantity: z.number().optional().describe("Initial quantity"),
      },
      async (params) => {
        try {
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const stk = item.ele(NS.stk, "stk:stock").att("version", "2.0");
            const hdr = stk.ele(NS.stk, "stk:stockHeader");
            hdr.ele(NS.stk, "stk:stockType").txt(params.stockType ?? "card");
            hdr.ele(NS.stk, "stk:code").txt(params.code);
            hdr.ele(NS.stk, "stk:name").txt(params.name);
            if (params.unit) hdr.ele(NS.stk, "stk:unit").txt(params.unit);
            if (params.store) hdr.ele(NS.stk, "stk:storage").ele(NS.typ, "typ:ids").txt(params.store);
            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.sellingPriceVAT != null) hdr.ele(NS.stk, "stk:sellingPriceVAT").txt(String(params.sellingPriceVAT));
            if (params.rateVAT) hdr.ele(NS.stk, "stk:rateVAT").txt(params.rateVAT);
            if (params.quantity != null) hdr.ele(NS.stk, "stk:count").txt(String(params.quantity));
            if (params.description) hdr.ele(NS.stk, "stk:description").txt(params.description);
            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 created. ${result.message}${result.producedId ? ` ID: ${result.producedId}` : ""}`)
            : err(`Failed to create stock item: ${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