Skip to main content
Glama
hlebtkachenko

POHODA MCP Server

pohoda_create_invoice

Create invoices in POHODA accounting software by specifying invoice type, date, partner details, line items, and symbols to automate billing processes.

Instructions

Create a new invoice in POHODA. Requires invoiceType and date. Optional: dateTax, dateDue, dateAccounting, text, partner details, symbols, note, and line items.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceTypeYesInvoice type (required)
dateYesInvoice date (DD.MM.YYYY or YYYY-MM-DD)
dateTaxNoTax date
dateDueNoDue date
dateAccountingNoAccounting date
textNoInvoice text/description
partnerNameNoPartner company name
partnerStreetNoPartner street
partnerCityNoPartner city
partnerZipNoPartner ZIP code
partnerIcoNoPartner IČO
partnerDicNoPartner DIČ
symVarNoVariable symbol
symConstNoConstant symbol
symSpecNoSpecific symbol
noteNoNote
intNoteNoInternal note
itemsNoLine items: text, quantity, unitPrice, rateVAT (none|low|high), optional unit, code

Implementation Reference

  • The implementation of the `pohoda_create_invoice` MCP tool, including its Zod schema definition, XML request builder construction, and result handling.
    server.tool(
      "pohoda_create_invoice",
      "Create a new invoice in POHODA. Requires invoiceType and date. Optional: dateTax, dateDue, dateAccounting, text, partner details, symbols, note, and line items.",
      {
        invoiceType: invoiceTypeEnum.describe("Invoice type (required)"),
        date: z.string().describe("Invoice date (DD.MM.YYYY or YYYY-MM-DD)"),
        dateTax: z.string().optional().describe("Tax date"),
        dateDue: z.string().optional().describe("Due date"),
        dateAccounting: z.string().optional().describe("Accounting date"),
        text: z.string().optional().describe("Invoice text/description"),
        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"),
        partnerDic: z.string().optional().describe("Partner DIČ"),
        symVar: z.string().optional().describe("Variable symbol"),
        symConst: z.string().optional().describe("Constant symbol"),
        symSpec: z.string().optional().describe("Specific symbol"),
        note: z.string().optional().describe("Note"),
        intNote: z.string().optional().describe("Internal note"),
        items: z
          .array(invoiceItemSchema)
          .optional()
          .describe("Line items: text, quantity, unitPrice, rateVAT (none|low|high), optional unit, code"),
      },
      async (params) => {
        try {
          const xml = buildImportDoc({ ico: client.ico }, (item) => {
            const inv = item.ele(NS.inv, "inv:invoice").att("version", "2.0");
            const header = inv.ele(NS.inv, "inv:invoiceHeader");
    
            header.ele(NS.inv, "inv:invoiceType").txt(params.invoiceType);
            header.ele(NS.inv, "inv:date").txt(toIsoDate(params.date));
            if (params.dateTax) header.ele(NS.inv, "inv:dateTax").txt(toIsoDate(params.dateTax));
            if (params.dateDue) header.ele(NS.inv, "inv:dateDue").txt(toIsoDate(params.dateDue));
            if (params.dateAccounting)
              header.ele(NS.inv, "inv:dateAccounting").txt(toIsoDate(params.dateAccounting));
            if (params.text) header.ele(NS.inv, "inv:text").txt(params.text);
    
            const hasPartner =
              params.partnerName ??
              params.partnerStreet ??
              params.partnerCity ??
              params.partnerZip ??
              params.partnerIco ??
              params.partnerDic;
            if (hasPartner) {
              const identity = header.ele(NS.inv, "inv: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.partnerDic) typAddr.ele(NS.typ, "typ:dic").txt(params.partnerDic);
            }
    
            if (params.symVar) header.ele(NS.inv, "inv:symVar").txt(params.symVar);
            if (params.symConst) header.ele(NS.inv, "inv:symConst").txt(params.symConst);
            if (params.symSpec) header.ele(NS.inv, "inv:symSpec").txt(params.symSpec);
            if (params.note) header.ele(NS.inv, "inv:note").txt(params.note);
            if (params.intNote) header.ele(NS.inv, "inv:intNote").txt(params.intNote);
    
            if (params.items && params.items.length > 0) {
              const detail = inv.ele(NS.inv, "inv:invoiceDetail");
              for (const it of params.items) {
                const invItem = detail.ele(NS.inv, "inv:invoiceItem");
                invItem.ele(NS.inv, "inv:text").txt(it.text);
                invItem.ele(NS.inv, "inv:quantity").txt(String(it.quantity));
                if (it.unit) invItem.ele(NS.inv, "inv:unit").txt(it.unit);
                invItem.ele(NS.inv, "inv:rateVAT").txt(it.rateVAT);
                invItem.ele(NS.inv, "inv:homeCurrency").ele(NS.typ, "typ:unitPrice").txt(String(it.unitPrice));
                if (it.code) invItem.ele(NS.inv, "inv:code").txt(it.code);
              }
            }
    
            inv.ele(NS.inv, "inv:invoiceSummary");
          });
          const response = await client.sendXml(xml);
          const result = extractImportResult(parseResponse(response));
          return result.success
            ? ok(
                `Invoice created successfully.${result.producedId != null ? ` ID: ${result.producedId}` : ""} ${result.message}`
              )
            : err(result.message);
        } catch (e) {
          return err((e as Error).message);
        }
      }
    );
Behavior2/5

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

No annotations provided, so description carries full burden. States 'Create' implying mutation, but lacks details on side effects (e.g., accounting period locking), error states, idempotency, or return value structure.

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?

Two sentences with zero waste: first establishes purpose, second documents requirements. Front-loaded and efficiently structured.

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

Completeness3/5

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

Adequate for 18 parameters with full schema coverage, but gaps remain: no output schema means return values are undocumented, and lacking annotations, the description should mention success indicators or failure modes.

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?

Schema description coverage is 100%, establishing baseline 3. Description groups parameters ('partner details, symbols') but adds minimal semantic value beyond the schema's own field descriptions.

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?

States specific action ('Create a new invoice') and target system ('POHODA'). However, it implies only invoices are created, while the invoiceType enum includes credit notes, receivables, and commitments—narrower than actual capability.

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?

Lists required fields ('Requires invoiceType and date') but provides no guidance on when to use this tool versus siblings like pohoda_create_offer or pohoda_create_order, nor when to select specific invoiceType values like issuedCreditNote versus issuedInvoice.

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