Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_create_voucher

Create cash vouchers (receipts or expenses) in POHODA accounting software. Specify voucher type, date, and optional details like cash register, partner information, and line items.

Instructions

Create a cash voucher (receipt or expense) in POHODA. Requires voucherType and date. Optional: cashRegister, text, symbols, partner details, note, and line items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
voucherTypeYesVoucher type: receipt or expense (required)
cashRegisterNoCash register identifier
dateYesDocument date (DD.MM.YYYY or YYYY-MM-DD)
textNoDocument text/description
symVarNoVariable symbol
symConstNoConstant symbol
partnerNameNoPartner company name
partnerStreetNoPartner street
partnerCityNoPartner city
partnerZipNoPartner ZIP code
partnerIcoNoPartner IČO
noteNoNote
itemsNoLine items: text, quantity, unitPrice, rateVAT (none|low|high)

Implementation Reference

  • The handler function that creates the voucher by building the XML request and parsing the result.
    async (params) => {
      try {
        const xml = buildImportDoc({ ico: client.ico }, (item) => {
          const vch = item.ele(NS.vch, "vch:voucher").att("version", "2.0");
          const header = vch.ele(NS.vch, "vch:voucherHeader");
    
          header.ele(NS.vch, "vch:voucherType").txt(params.voucherType);
          if (params.cashRegister) {
            header.ele(NS.vch, "vch:cashRegister").ele(NS.typ, "typ:ids").txt(params.cashRegister);
          }
          header.ele(NS.vch, "vch:date").txt(toIsoDate(params.date));
          if (params.text) header.ele(NS.vch, "vch:text").txt(params.text);
          if (params.symVar) header.ele(NS.vch, "vch:symVar").txt(params.symVar);
          if (params.symConst) header.ele(NS.vch, "vch:symConst").txt(params.symConst);
    
          const hasPartner =
            params.partnerName ?? params.partnerStreet ?? params.partnerCity ?? params.partnerZip ?? params.partnerIco;
          if (hasPartner) {
            const identity = header.ele(NS.vch, "vch:partnerIdentity");
            const typAddr = identity.ele(NS.typ, "typ:address");
            if (params.partnerName) typAddr.ele(NS.typ, "typ:name").txt(params.partnerName);
            if (params.partnerStreet) typAddr.ele(NS.typ, "typ:street").txt(params.partnerStreet);
            if (params.partnerCity) typAddr.ele(NS.typ, "typ:city").txt(params.partnerCity);
            if (params.partnerZip) typAddr.ele(NS.typ, "typ:zip").txt(params.partnerZip);
            if (params.partnerIco) typAddr.ele(NS.typ, "typ:ico").txt(params.partnerIco);
          }
    
          if (params.note) header.ele(NS.vch, "vch:note").txt(params.note);
    
          if (params.items && params.items.length > 0) {
            const detail = vch.ele(NS.vch, "vch:voucherDetail");
            for (const it of params.items) {
              const vchItem = detail.ele(NS.vch, "vch:voucherItem");
              vchItem.ele(NS.vch, "vch:text").txt(it.text);
              vchItem.ele(NS.vch, "vch:quantity").txt(String(it.quantity));
              vchItem.ele(NS.vch, "vch:rateVAT").txt(it.rateVAT);
              vchItem
                .ele(NS.vch, "vch:homeCurrency")
                .ele(NS.typ, "typ:unitPrice")
                .txt(String(it.unitPrice));
            }
          }
        });
        const response = await client.sendXml(xml);
        const result = extractImportResult(parseResponse(response));
        return result.success
          ? ok(
              `Voucher created successfully.${result.producedId != null ? ` ID: ${result.producedId}` : ""} ${result.message}`
            )
          : err(result.message);
  • The input validation schema for the 'pohoda_create_voucher' tool.
    {
      voucherType: voucherTypeEnum.describe("Voucher type: receipt or expense (required)"),
      cashRegister: z.string().optional().describe("Cash register identifier"),
      date: z.string().describe("Document date (DD.MM.YYYY or YYYY-MM-DD)"),
      text: z.string().optional().describe("Document text/description"),
      symVar: z.string().optional().describe("Variable symbol"),
      symConst: z.string().optional().describe("Constant symbol"),
      partnerName: z.string().optional().describe("Partner company name"),
      partnerStreet: z.string().optional().describe("Partner street"),
      partnerCity: z.string().optional().describe("Partner city"),
      partnerZip: z.string().optional().describe("Partner ZIP code"),
      partnerIco: z.string().optional().describe("Partner IČO"),
      note: z.string().optional().describe("Note"),
      items: z
        .array(voucherItemSchema)
        .optional()
        .describe("Line items: text, quantity, unitPrice, rateVAT (none|low|high)"),
    },
  • The registration of the 'pohoda_create_voucher' tool within the server.
    server.tool(
      "pohoda_create_voucher",
      "Create a cash voucher (receipt or expense) in POHODA. Requires voucherType and date. Optional: cashRegister, text, symbols, partner details, note, and line items.",
      {
        voucherType: voucherTypeEnum.describe("Voucher type: receipt or expense (required)"),
        cashRegister: z.string().optional().describe("Cash register identifier"),
        date: z.string().describe("Document date (DD.MM.YYYY or YYYY-MM-DD)"),
        text: z.string().optional().describe("Document text/description"),
        symVar: z.string().optional().describe("Variable symbol"),
        symConst: z.string().optional().describe("Constant symbol"),
        partnerName: z.string().optional().describe("Partner company name"),
        partnerStreet: z.string().optional().describe("Partner street"),
        partnerCity: z.string().optional().describe("Partner city"),
        partnerZip: z.string().optional().describe("Partner ZIP code"),
        partnerIco: z.string().optional().describe("Partner IČO"),
        note: z.string().optional().describe("Note"),
        items: z
          .array(voucherItemSchema)
          .optional()
          .describe("Line items: text, quantity, unitPrice, rateVAT (none|low|high)"),
      },
      async (params) => {
        try {
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const vch = item.ele(NS.vch, "vch:voucher").att("version", "2.0");
            const header = vch.ele(NS.vch, "vch:voucherHeader");
    
            header.ele(NS.vch, "vch:voucherType").txt(params.voucherType);
            if (params.cashRegister) {
              header.ele(NS.vch, "vch:cashRegister").ele(NS.typ, "typ:ids").txt(params.cashRegister);
            }
            header.ele(NS.vch, "vch:date").txt(toIsoDate(params.date));
            if (params.text) header.ele(NS.vch, "vch:text").txt(params.text);
            if (params.symVar) header.ele(NS.vch, "vch:symVar").txt(params.symVar);
            if (params.symConst) header.ele(NS.vch, "vch:symConst").txt(params.symConst);
    
            const hasPartner =
              params.partnerName ?? params.partnerStreet ?? params.partnerCity ?? params.partnerZip ?? params.partnerIco;
            if (hasPartner) {
              const identity = header.ele(NS.vch, "vch:partnerIdentity");
              const typAddr = identity.ele(NS.typ, "typ:address");
              if (params.partnerName) typAddr.ele(NS.typ, "typ:name").txt(params.partnerName);
              if (params.partnerStreet) typAddr.ele(NS.typ, "typ:street").txt(params.partnerStreet);
              if (params.partnerCity) typAddr.ele(NS.typ, "typ:city").txt(params.partnerCity);
              if (params.partnerZip) typAddr.ele(NS.typ, "typ:zip").txt(params.partnerZip);
              if (params.partnerIco) typAddr.ele(NS.typ, "typ:ico").txt(params.partnerIco);
            }
    
            if (params.note) header.ele(NS.vch, "vch:note").txt(params.note);
    
            if (params.items && params.items.length > 0) {
              const detail = vch.ele(NS.vch, "vch:voucherDetail");
              for (const it of params.items) {
                const vchItem = detail.ele(NS.vch, "vch:voucherItem");
                vchItem.ele(NS.vch, "vch:text").txt(it.text);
                vchItem.ele(NS.vch, "vch:quantity").txt(String(it.quantity));
                vchItem.ele(NS.vch, "vch:rateVAT").txt(it.rateVAT);
                vchItem
                  .ele(NS.vch, "vch:homeCurrency")
                  .ele(NS.typ, "typ:unitPrice")
                  .txt(String(it.unitPrice));
              }
            }
          });
          const response = await client.sendXml(xml);
          const result = extractImportResult(parseResponse(response));
          return result.success
            ? ok(
                `Voucher created successfully.${result.producedId != null ? ` ID: ${result.producedId}` : ""} ${result.message}`
              )
            : err(result.message);
        } catch (e) {
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but only states 'Create' without explaining side effects (e.g., immediate accounting impact, cash balance updates), reversibility (notably, no delete_voucher exists in siblings), or error conditions. Critical gaps for a financial mutation tool.

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

Conciseness5/5

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

The description is optimally concise with two efficiently structured sentences: the first establishes purpose, the second outlines required vs. optional parameters. No redundant or wasted text.

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 financial tool with 13 parameters, nested line item objects, no output schema, and no annotations, the description is insufficient. It lacks critical context such as whether items are required for valid accounting, if the operation posts immediately or creates drafts, and how to handle the returned result.

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

Parameters3/5

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

With 100% schema description coverage, the baseline is 3. The description adds minimal semantic grouping by clustering 'symbols' and 'partner details,' but provides no additional format guidance, examples, or validation rules beyond what the schema already documents.

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 clearly states the tool creates a 'cash voucher (receipt or expense)' with specific document types, distinguishing it from sibling tools like create_invoice or create_order. However, it assumes familiarity with POHODA without explanation and doesn't clarify the business distinction between cash vouchers and similar transaction documents like prodejka/prijemka.

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?

The description lists required fields (voucherType, date) and optional ones but provides no guidance on when to use this tool versus alternatives (e.g., when to use a cash voucher vs. an invoice) or workflow prerequisites such as whether the cash register must exist beforehand.

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