Skip to main content
Glama

Create provision (Draft)

create_provision

Create a provision document (avance sur honoraires, retainer) in Draft status for a company, optionally attached to a matter. NOT issued or certified - use send_provision for the legal issuance. VAT is computed automatically by strict server-side fiscal rules - never ask the user for a VAT rate. Provisions use their own PROV number series and, once paid, become a client credit deductible from the final invoice (apply_provisions_to_invoice).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesLine items in display order (1-100).
notesNoFree text printed on the provision (max 2000 characters).
currencyNoISO 4217 currency code. Defaults to EUR.
due_dateYesDue date, YYYY-MM-DD, on or after issue_date.
matter_idNoMatter UUID to attach the retainer to; omit for a standalone retainer, which is the normal case in Kema Invoice.
company_idYesCustomer company UUID (use list_companies to resolve).
issue_dateYesIssue date, YYYY-MM-DD.
payment_termsNoPayment terms printed on the provision. Defaults to 'Due on Receipt'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice UUID.
typeYesDocument type: invoice, credit_note, provision or quote.
notesYesNotes printed on the document.
statusYesDocument status: Draft, Sent, Paid, Overdue, Cancelled, Rectified, Accepted, Rejected or Expired.
paid_atYesPayment timestamp (ISO 8601), null while unpaid.
sent_atYesIssue timestamp (ISO 8601), null while Draft.
currencyYesISO 4217 currency code (EUR, USD, GBP or CHF).
due_dateYesDue date, YYYY-MM-DD.
matter_idYesMatter (dossier) UUID, null when unassigned.
net_totalYesTotal excl. VAT, in the document currency.
tax_totalYesVAT amount, in the document currency.
amount_dueYesGross total minus applied provisions, null when not computed.
company_idYesClient company UUID.
created_atYesCreation timestamp (ISO 8601).
issue_dateYesIssue date, YYYY-MM-DD.
updated_atYesLast update timestamp (ISO 8601).
gross_totalYesTotal incl. VAT, in the document currency.
valid_untilYesQuote validity limit, YYYY-MM-DD; null for other types.
vat_scenarioYesFiscal scenario frozen at creation (e.g. domestic, eu_b2b_reverse_charge).
payment_termsYesPayment terms: Net-15, Net-30, Net-60, Net-90 or Due on Receipt.
advances_totalYesSum of provisions applied, in the document currency.
created_sourceYesOrigin of the document: manual (app) or mcp (agent).
credit_note_idYesCredit note UUID that cancelled this invoice.
internal_notesYesPrivate notes, never printed.
invoice_numberYesHuman-readable document number.
invopop_statusYesFiscal certification status from the provider, null before issuance.
source_quote_idYesQuote UUID this invoice was converted from.
delivery_channelYesDelivery channel: Email, e-Invoice or Manual.
replaces_invoice_idYesOriginal invoice UUID when this is a rectificative.
replaced_by_invoice_idYesRectificative UUID when this invoice was rectified.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / matter_id / description
      Previous value: -"Matter (dossier) UUID - required for provisions."New value: +"Matter UUID to attach the retainer to; omit for a standalone retainer, which is the normal case in Kema Invoice."
    • changedInput schema / required
      Previous value: -[
      -  "company_id",
      -  "matter_id",
      -  "issue_date",
      -  "due_date",
      -  "items"
      -]New value: +[
      +  "company_id",
      +  "issue_date",
      +  "due_date",
      +  "items"
      +]
  2. Changed11 schema fields changed
    • addedInput schema / properties / currency / description
      Added value: +"ISO 4217 currency code. Defaults to EUR."
    • addedInput schema / properties / items / description
      Added value: +"Line items in display order (1-100)."
    • addedInput schema / properties / items / items / properties / description / description
      Added value: +"Line text printed on the provision (1-500 characters)."
    • changedInput schema / properties / items / items / properties / line_type / description
      Previous value: -"Defaults to 'item'."New value: +"Line kind: 'item' (billable, needs quantity and unit_price), 'section' (visual header) or 'description' (text-only sub-line). Defaults to 'item'."
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Required for 'item' lines."New value: +"Quantity. Required for 'item' lines."
    • changedInput schema / properties / items / items / properties / tax_rate / description
      Previous value: -"OMIT — do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules (default rate + automatic 0% for reverse-charge/export scenarios). Only set when the user explicitly states a rate."New value: +"OMIT - do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules (default rate + automatic 0% for reverse-charge/export scenarios). Only set when the user explicitly states a rate, as a percent (0-100)."
    • changedInput schema / properties / items / items / properties / unit_price / description
      Previous value: -"Required for 'item' lines."New value: +"Unit price excl. VAT, in the provision currency. Required for 'item' lines."
    • changedInput schema / properties / matter_id / description
      Previous value: -"Matter (dossier) UUID — required for provisions."New value: +"Matter (dossier) UUID - required for provisions."
    • addedInput schema / properties / notes / description
      Added value: +"Free text printed on the provision (max 2000 characters)."
    • changedInput schema / properties / payment_terms / description
      Previous value: -"Defaults to 'Due on Receipt'."New value: +"Payment terms printed on the provision. Defaults to 'Due on Receipt'."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "advances_total": {
      +      "description": "Sum of provisions applied, in the document currency.",
      +      "type": "number"
      +    },
      +    "amount_due": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Gross total minus applied provisions, null when not computed."
      +    },
      +    "company_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Client company UUID."
      +    },
      +    "created_at": {
      +      "description": "Creation timestamp (ISO 8601).",
      +      "type": "string"
      +    },
      +    "created_source": {
      +      "description": "Origin of the document: manual (app) or mcp (agent).",
      +      "type": "string"
      +    },
      +    "credit_note_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Credit note UUID that cancelled this invoice."
      +    },
      +    "currency": {
      +      "description": "ISO 4217 currency code (EUR, USD, GBP or CHF).",
      +      "type": "string"
      +    },
      +    "delivery_channel": {
      +      "description": "Delivery channel: Email, e-Invoice or Manual.",
      +      "type": "string"
      +    },
      +    "due_date": {
      +      "description": "Due date, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "gross_total": {
      +      "description": "Total incl. VAT, in the document currency.",
      +      "type": "number"
      +    },
      +    "id": {
      +      "description": "Invoice UUID.",
      +      "type": "string"
      +    },
      +    "internal_notes": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Private notes, never printed."
      +    },
      +    "invoice_number": {
      +      "description": "Human-readable document number.",
      +      "type": "string"
      +    },
      +    "invopop_status": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Fiscal certification status from the provider, null before issuance."
      +    },
      +    "issue_date": {
      +      "description": "Issue date, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "matter_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Matter (dossier) UUID, null when unassigned."
      +    },
      +    "net_total": {
      +      "description": "Total excl. VAT, in the document currency.",
      +      "type": "number"
      +    },
      +    "notes": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Notes printed on the document."
      +    },
      +    "paid_at": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Payment timestamp (ISO 8601), null while unpaid."
      +    },
      +    "payment_terms": {
      +      "description": "Payment terms: Net-15, Net-30, Net-60, Net-90 or Due on Receipt.",
      +      "type": "string"
      +    },
      +    "replaced_by_invoice_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Rectificative UUID when this invoice was rectified."
      +    },
      +    "replaces_invoice_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Original invoice UUID when this is a rectificative."
      +    },
      +    "sent_at": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Issue timestamp (ISO 8601), null while Draft."
      +    },
      +    "source_quote_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Quote UUID this invoice was converted from."
      +    },
      +    "status": {
      +      "description": "Document status: Draft, Sent, Paid, Overdue, Cancelled, Rectified, Accepted, Rejected or Expired.",
      +      "type": "string"
      +    },
      +    "tax_total": {
      +      "description": "VAT amount, in the document currency.",
      +      "type": "number"
      +    },
      +    "type": {
      +      "description": "Document type: invoice, credit_note, provision or quote.",
      +      "type": "string"
      +    },
      +    "updated_at": {
      +      "description": "Last update timestamp (ISO 8601).",
      +      "type": "string"
      +    },
      +    "valid_until": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Quote validity limit, YYYY-MM-DD; null for other types."
      +    },
      +    "vat_scenario": {
      +      "description": "Fiscal scenario frozen at creation (e.g. domestic, eu_b2b_reverse_charge).",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "invoice_number",
      +    "type",
      +    "status",
      +    "company_id",
      +    "matter_id",
      +    "issue_date",
      +    "due_date",
      +    "valid_until",
      +    "currency",
      +    "payment_terms",
      +    "delivery_channel",
      +    "net_total",
      +    "tax_total",
      +    "gross_total",
      +    "advances_total",
      +    "amount_due",
      +    "notes",
      +    "internal_notes",
      +    "paid_at",
      +    "sent_at",
      +    "invopop_status",
      +    "vat_scenario",
      +    "source_quote_id",
      +    "replaces_invoice_id",
      +    "replaced_by_invoice_id",
      +    "credit_note_id",
      +    "created_source",
      +    "created_at",
      +    "updated_at"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and destructiveHint=false. The description adds meaningful behavioral context beyond those: VAT is computed server-side, provisions use their own number series, and once paid they become a client credit. This gives the agent insight into side effects and constraints not covered by annotations.

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 a single compact paragraph with no redundancy. Each sentence adds a distinct piece of information: purpose, state, VAT rule, and number series. It is front-loaded with the core action and efficiently packs constraints without verbosity.

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

Completeness5/5

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

Given the complexity (8 params, 4 required, nested items), the description covers the full workflow context: draft creation, VAT handling, matter attachment, and relationship to sibling tools (send_provision, list_companies). Since an output schema exists, return values need not be explained. The description is complete for an agent to invoke correctly.

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

Parameters4/5

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

The schema covers all parameters with descriptions, but the description adds extra semantics: tax_rate is explicitly flagged as 'OMIT - do NOT ask' with conditions for setting, and matter_id is noted as 'omit for a standalone retainer, normal case.' These go beyond the schema and improve parameter understanding.

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?

Clearly states the tool creates a provision document in Draft status for a company, optionally attached to a matter, and explicitly distinguishes it from sending (use send_provision). The verb 'Create' and resource 'provision' are specific, and the mention of 'NOT issued or certified' removes ambiguity.

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

Usage Guidelines5/5

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

Provides explicit guidance on when NOT to use this tool (for issuing) and directs to send_provision. It also instructs the agent to never ask for a VAT rate, explaining when to set tax_rate (only when user explicitly states). These are clear, actionable instructions with no ambiguity.

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.