Skip to main content
Glama

myinvois_invoice_generate

Mint a sealed LHDN e-invoice in ONE call: invoice_type, line_items (unit_price_cents in integer CENTS, tax_rate_bps in basis points), and a buyer as customer_id or an inline buyer object. Refuses until myinvois_settings_save is done; invoice_type 02/03/04 also needs original_invoice_id naming a type-01 invoice with a recorded LHDN UUID, checked BEFORE the number is claimed, so a rejected note never burns a number. The result is immutable and carries portal_field_sheet; Simpler never submits it to LHDN. NEXT: the owner keys the field sheet into the MyInvois portal form, then myinvois_invoice_record_submission with the UUID the portal assigns.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "line_items": "<line_items>"
    },
    "name": "myinvois_invoice_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
buyerNoInline one-off buyer party — {name, tin, brn?, address?, city?, state_code?, postal_code?, country_code?, email?, contact_number?}. Required when customer_id is not given; ignored when it is.
notesNoFree-text notes printed on the generated e-invoice; optional.
statusNo
currencyNo
buyer_tinNo
lhdn_uuidNo
tax_centsNo
buyer_nameNo
issue_dateNo
line_itemsYesLine items: [{description, quantity, unit_price_cents, tax_rate_bps?, tax_type?, classification_code?, unit_code?}]. Money is integer CENTS, tax_rate_bps is basis points (600 = 6%); tax_type/classification_code/unit_code default when omitted and validate against the LHDN code tables (GET /api/myinvois/codes).
customer_idNo
total_centsNo
invoice_dataNo
invoice_typeNo
lhdn_long_idNo
payment_termsNoPayment terms text for this document; defaults to the supplier profile's default_payment_terms when omitted.
billing_periodNoOptional LHDN billing period {start_date, end_date, frequency?}: dates as YYYY-MM-DD, end on or after start, frequency up to 50 characters (for example Monthly). Leave it out when the invoice covers no period; the e-invoice then carries none.
invoice_numberNo
subtotal_centsNo
lhdn_submitted_atNo
original_invoice_idNoThe type-01 original this note references — required for invoice_type 02, 03 or 04, refused for 01. Must already carry an LHDN UUID (myinvois_invoice_record_submission).
reference_invoice_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly=false, destructive=false, idempotent=false; the description goes well beyond by disclosing the hard precondition, the ordering guarantee that original_invoice_id is checked BEFORE the number is claimed (so a rejected note never burns a number), the immutability of the result, and that it carries portal_field_sheet but never submits. These are exactly the side-effect details an agent cannot infer from the schema.

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?

Roughly 110 words that front-load purpose, then pack preconditions, parameter conventions, validation ordering, result semantics and the next step with no filler sentence. Every clause carries information the agent needs.

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

Completeness4/5

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

For a 22-parameter, nested-object mutation with no output schema, the description supplies the essential contract: prerequisites, gating rules, immutability, and the handoff path. It stops short of describing the returned document's shape beyond noting portal_field_sheet, so the agent still doesn't know the full result payload.

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 coverage is only 27% across 22 parameters, so the description must compensate, and it does cover the decision-critical ones: money as integer cents, tax_rate_bps as basis points, buyer as customer_id-or-inline, and original_invoice_id's type gating. But it says nothing about the many remaining fields (subtotal_cents, tax_cents, total_cents, invoice_number, status, currency, lhdn_uuid, invoice_data, reference_invoice_id), leaving the agent unsure which are caller-supplied versus server-computed.

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

Purpose5/5

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

The description opens with a specific verb and resource ("Mint a sealed LHDN e-invoice in ONE call") and immediately scopes it with the fields that matter (invoice_type, line_items, buyer). It is clearly distinguishable from myinvois_invoice_record_submission (which it names as the next step) and from generic invoice creation, since it states Simpler never submits to LHDN itself.

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

Usage Guidelines4/5

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

It gives explicit preconditions ("Refuses until myinvois_settings_save is done") and routes the agent forward to myinvois_invoice_record_submission with the portal-assigned UUID. What's missing is an explicit exclusion — e.g. when to use invoice_create or myinvois_template instead — so the when-not side is left implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources