Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_create_vyroba

Create production documents in POHODA accounting software by specifying date, items, quantities, and descriptions for manufacturing records.

Instructions

Create a production document (výroba) in POHODA

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesDocument date (DD.MM.YYYY or YYYY-MM-DD)
textNoDescription
noteNo
itemsNoProduction items

Implementation Reference

  • Implementation and registration of the 'pohoda_create_vyroba' tool.
    server.tool(
      "pohoda_create_vyroba",
      "Create a production document (výroba) in POHODA",
      {
        date: z.string().describe("Document date (DD.MM.YYYY or YYYY-MM-DD)"),
        text: z.string().optional().describe("Description"),
        note: z.string().optional(),
        items: z.array(z.object({
          text: z.string(),
          quantity: z.number(),
          unitPrice: z.number(),
          unit: z.string().optional(),
          stockCode: z.string().optional(),
        })).optional().describe("Production items"),
      },
      async (params) => {
        try {
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const doc = item.ele(NS.vyr, "vyr:vyroba").att("version", "2.0");
            const hdr = doc.ele(NS.vyr, "vyr:vyrobaHeader");
            hdr.ele(NS.vyr, "vyr:date").txt(toIsoDate(params.date));
            if (params.text) hdr.ele(NS.vyr, "vyr:text").txt(params.text);
            if (params.note) hdr.ele(NS.vyr, "vyr:note").txt(params.note);
    
            if (params.items?.length) {
              const det = doc.ele(NS.vyr, "vyr:vyrobaDetail");
              for (const i of params.items) {
                const li = det.ele(NS.vyr, "vyr:vyrobaItem");
                li.ele(NS.vyr, "vyr:text").txt(i.text);
                li.ele(NS.vyr, "vyr:quantity").txt(String(i.quantity));
                if (i.unit) li.ele(NS.vyr, "vyr:unit").txt(i.unit);
                li.ele(NS.vyr, "vyr:homeCurrency").ele(NS.typ, "typ:unitPrice").txt(String(i.unitPrice));
                if (i.stockCode) {
                  li.ele(NS.vyr, "vyr:stockItem").ele(NS.typ, "typ:stockItem").ele(NS.typ, "typ:ids").txt(i.stockCode);
                }
              }
            }
          });
          const resp = parseResponse(await client.sendXml(xml));
          const result = extractImportResult(resp);
          return result.success
            ? ok(`Production document created. ${result.message}${result.producedId ? ` ID: ${result.producedId}` : ""}`)
            : 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