Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_create_vydejka

Create dispatch documents (výdejka) in POHODA accounting software by specifying date, partner details, and line items for inventory management.

Instructions

Create a dispatch document (výdejka) in POHODA

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesDocument date (DD.MM.YYYY or YYYY-MM-DD)
textNoDocument text
noteNoNote
partnerNameNo
partnerStreetNo
partnerCityNo
partnerZipNo
partnerIcoNo
itemsNoLine items

Implementation Reference

  • The `buildWarehouseCreateTool` function is a generic factory that builds and registers MCP tools for creating various document types, including 'pohoda_create_vydejka'. It encapsulates the logic for constructing the XML import request, sending it to the POHODA client, and processing the response.
    function buildWarehouseCreateTool(
      server: McpServer,
      client: PohodaClient,
      toolName: string,
      description: string,
      ns: string,
      prefix: string,
      docTag: string,
      headerTag: string,
      detailTag: string,
      itemTag: string,
    ) {
      server.tool(
        toolName,
        description,
        {
          date: z.string().describe("Document date (DD.MM.YYYY or YYYY-MM-DD)"),
          text: z.string().optional().describe("Document text"),
          note: z.string().optional().describe("Note"),
          ...partnerFields,
          items: z.array(itemSchema).optional().describe("Line items"),
        },
        async (params) => {
          try {
            const xml = buildImportDoc({ ico: client.ico }, (item) => {
              const doc = item.ele(ns, `${prefix}:${docTag}`).att("version", "2.0");
              const hdr = doc.ele(ns, `${prefix}:${headerTag}`);
              hdr.ele(ns, `${prefix}:date`).txt(toIsoDate(params.date));
              if (params.text) hdr.ele(ns, `${prefix}:text`).txt(params.text);
              addPartner(hdr, prefix, ns, params);
              if (params.note) hdr.ele(ns, `${prefix}:note`).txt(params.note);
    
              if (params.items?.length) {
                const det = doc.ele(ns, `${prefix}:${detailTag}`);
                for (const i of params.items) {
                  const li = det.ele(ns, `${prefix}:${itemTag}`);
                  li.ele(ns, `${prefix}:text`).txt(i.text);
                  li.ele(ns, `${prefix}:quantity`).txt(String(i.quantity));
                  if (i.unit) li.ele(ns, `${prefix}:unit`).txt(i.unit);
                  if (i.rateVAT) li.ele(ns, `${prefix}:rateVAT`).txt(i.rateVAT);
                  li.ele(ns, `${prefix}:homeCurrency`).ele(NS.typ, "typ:unitPrice").txt(String(i.unitPrice));
                  if (i.stockCode) {
                    li.ele(ns, `${prefix}: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(`Document created. ${result.message}${result.producedId ? ` ID: ${result.producedId}` : ""}`)
              : err(`Failed: ${result.message}`);
          } catch (e) {
            return err((e as Error).message);
          }
        },
      );
    }
  • The 'pohoda_create_vydejka' tool is explicitly registered by calling `buildWarehouseCreateTool` within the `registerWarehouseTools` function.
    buildWarehouseCreateTool(server, client, "pohoda_create_vydejka", "Create a dispatch document (výdejka) in POHODA", NS.vyd, "vyd", "vydejka", "vydejkaHeader", "vydejkaDetail", "vydejkaItem");
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create' implying mutation, but provides no details about side effects (stock level changes), reversibility, error handling, or return values. The agent cannot determine if this performs an immediate stock write-off or creates a draft document.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is efficient and front-loaded, but undersized for the tool's complexity (9 parameters including nested line items). While not wasteful, it lacks the necessary depth for a document creation tool with business logic implications.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex business document creation tool with nested line items and partner data, the description is inadequate. Missing critical context includes: VAT handling behavior, stock movement implications, required vs optional fields beyond the schema, and success/failure response patterns. No output schema exists to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 44% (partner fields and most item fields undocumented). The description lists no parameters and provides no semantic guidance to compensate—such as explaining that partner fields identify the recipient, or that stockCode links to inventory items. Baseline 3 reduced due to failure to compensate for low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description provides a clear verb ('Create'), specific resource ('dispatch document/výdejka'), and system context ('POHODA'). The parenthetical Czech term helps distinguish it from siblings like create_prodejka or create_invoice, though it doesn't explain the business distinction between these similar document types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance provided on when to use this tool versus similar siblings (create_prodejka, create_invoice, create_prevodka). Given the extensive list of document creation tools in this ERP system, explicit differentiation would be necessary for correct agent selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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