Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_generate_payment_event_draft

Idempotent

Creates a draft invoice for a payment event that automation could not invoice, applying the same recipient and tax rules. It only drafts eligible events; you issue it later.

Instructions

Builds a draft invoice from a payment event that could not be invoiced automatically, applying the same recipient resolution and tax treatment the automatic flow would have applied, under the NIF in the path.

  • Draft only: the document is not issued, not numbered against the series and not emailed. Issue it yourself once it is right.

  • Eligible events: only those that produced no invoice can produce a draft; otherwise the request returns 400.

  • Rejected documents: if invoicing rules reject the resulting document the request returns 422 and no draft is created.

Endpoint: POST /v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/draft

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesIdentifier of the payment event, as returned by the list operation.
company_idYesUnique identifier (UUID) of the company the events belong to — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed.
connection_idYesUnique identifier (UUID) of the payment connection the operation acts on, as returned by `GET /v1/companies/{company_id}/payment-connections`. A NIF can hold several connections of the same provider, so the provider slug alone does not name one. A connection of another NIF answers `404`, exactly like one that does not exist.
idempotency_keyNoOptional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.9.0
    • addedInput schema / properties / connection_id
      Added value: +{
      +  "description": "Unique identifier (UUID) of the payment connection the operation acts on, as returned by `GET /v1/companies/{company_id}/payment-connections`. A NIF can hold several connections of the same provider, so the provider slug alone does not name one. A connection of another NIF answers `404`, exactly like one that does not exist.",
      +  "format": "uuid",
      +  "type": "string"
      +}
    • removedInput schema / properties / provider
      Removed value: -{
      -  "description": "Payment provider slug in **lowercase**. Currently only `stripe` (Stripe Connect) is\noperative; `woocommerce` and `shopify` are reserved for future providers.\n",
      -  "enum": [
      -    "stripe"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "company_id",
      -  "provider",
      -  "event_id"
      -]New value: +[
      +  "company_id",
      +  "connection_id",
      +  "event_id"
      +]
  2. Changed2 schema fields changedv0.5.0
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / company_id / description
      Previous value: -"NIF (company) the events belong to. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A NIF you do not reach answers `403`, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed."New value: +"Unique identifier (UUID) of the company the events belong to — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed."
  3. First observedv0.3.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true, destructiveHint=false and openWorldHint=true, so safety is largely covered. The description adds genuine behavioral context beyond that: the draft is not issued, not numbered against the series and not emailed, and it discloses the 400 and 422 failure conditions. It does not restate the idempotency semantics, which live in 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?

Front-loads the action in one sentence, then three tight bullets covering the draft-only constraint and both error paths, ending with the endpoint. Every sentence carries information; no filler.

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 mutating, open-world tool with no output schema, the description covers eligibility, side-effect boundaries and error behavior well. It stops short of indicating what the draft response contains or how to locate the created draft afterward, which would be the remaining useful detail.

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% and the parameter descriptions are unusually rich, so the baseline is 3. The description adds little parameter meaning; its phrase 'under the NIF in the path' is mildly at odds with the path, which actually carries company_id (the schema explicitly says it is the identifier, not the NIF), so it slightly muddies rather than clarifies.

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?

States a specific verb and resource ('Builds a draft invoice from a payment event') and scopes it precisely to events that could not be invoiced automatically, which distinguishes it from the automatic flow and from sibling payment-event operations like retry/resolve/restore. An agent can identify the action without opening the schema.

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?

Gives a clear selection condition — only events that produced no invoice are eligible, otherwise 400 — plus the follow-up guidance 'Issue it yourself once it is right'. It does not, however, explicitly name alternatives (e.g. beel_retry_payment_event, beel_resolve_payment_event, beel_issue_invoice) that an agent might weigh against it.

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

Deploy Server

Other Tools