Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_generate_payment_event_draft

Idempotent

Build a reviewable draft invoice from a Stripe payment event that was not auto-invoiced, reusing the standard recipient and tax logic.

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/{provider}/events/{event_id}/draft

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesIdentifier of the payment event, as returned by the list operation.
providerYesPayment provider slug in **lowercase**. Currently only `stripe` (Stripe Connect) is operative; `woocommerce` and `shopify` are reserved for future providers.
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.
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. 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."
  2. First observedv0.3.1

TDQS

A4.1/5.0
Behavior4/5

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

With annotations already providing read/write and idempotency hints, the description adds meaningful behavior: the document is draft-only, not issued/emailed, 400 on ineligible events, and 422 with no draft created on rejection. This goes beyond the structured fields without contradicting them.

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 compact, front-loaded with the core action, and uses short bullet points for the three material caveats. The endpoint line is useful and nothing is redundant.

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?

It covers eligibility, draft semantics, error outcomes, and endpoint, but does not describe the response/return value even though there is no output schema. The 'NIF in the path' wording is also inconsistent with the shown endpoint and company_id schema, which creates avoidable ambiguity.

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 each parameter already has a detailed description, so the baseline applies. The tool description adds little per-parameter meaning; in fact, its 'NIF in the path' phrase conflicts with the schema's company_id note that it is a UUID, not a NIF.

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 names a specific verb and resource ('Builds a draft invoice from a payment event') and scopes it to events that could not be invoiced automatically. It also clarifies the draft is not issued, numbered, or emailed, separating it from issue/create invoice siblings.

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 clear use-case context ('could not be invoiced automatically') and explicit eligibility restrictions with error behavior ('only those that produced no invoice... otherwise 400'). It does not explicitly name a sibling alternative for when automatic issuance or retry is preferred, so it stops short of a 5.

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