Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_discard_payment_event

Idempotent

Discard a payment event, removing it and all eligible events sharing its payment identity from the default list while retaining them in the audit trail for restoration.

Instructions

Removes a payment event from the default list (soft delete). The event stays in the audit trail and can be brought back with the restore operation.

The operation applies to the whole payment the event belongs to. Its scope is every active, eligible event of the connection that shares the payment identity of the event named in the request: when the event carries a payment identifier (external_payment_id), every event with that same identifier, whatever its kind (the sale, its failed attempts, its refunds); otherwise, when it carries a source object (source_object_id, such as a credit note or a dispute), every event with that same source object; otherwise, the event alone. All of them are discarded together, in a single transaction and with the same deleted_at timestamp. Events that are not eligible remain unchanged, and so do events still in RECEIVED state other than the one named in the request: they have not been processed yet and are left for processing. The response carries the event named in the request.

  • Eligible events: an event already linked to an issued invoice, or currently being processed, cannot be discarded; the request returns 400.

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

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. Addedv0.9.0

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: soft-delete semantics, audit-trail retention, single-transaction application with a shared deleted_at, untouched RECEIVED-state events, and the 400 condition for invoice-linked or in-processing events. This also explains why destructiveHint=false and idempotentHint=true hold, rather than 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the essential fact (soft delete, restorable) and the endpoint, then elaborates scope. The middle scope paragraph is dense and slightly repetitive about RECEIVED-state events, but nearly every sentence carries distinct behavioral information.

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?

Covers everything an agent needs for a mutation with no output schema: scope of effect, eligibility failure mode, idempotency behavior, and what the response returns ('carries the event named in the request'). Nothing material is missing.

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?

Schema description coverage is 100%, so the baseline is 3, but the prose adds real meaning: it clarifies that event_id drives a cascading scope over sibling events sharing a payment or source object, which the schema's one-line 'identifier of the payment event' does not convey.

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 ('Removes a payment event from the default list (soft delete)') and immediately distinguishes it from siblings by naming the restore operation and the audit-trail persistence. An agent can tell this apart from beel_restore_payment_event, beel_retry_payment_event, and beel_resolve_payment_event without opening a 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?

Explains the scope model in detail (whole payment when external_payment_id matches, source object grouping, otherwise the single event) and the alternative path back via restore. It does not explicitly say when NOT to use it beyond the eligibility/400 rule, but the operational context is clear.

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