Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_discard_payment_event

DestructiveIdempotent

Discards a payment event and eligible related events sharing its payment or source identity, while keeping them in the audit trail for later 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.

BeeL API endpoint: POST /v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/discard (reference: https://docs.beel.es)

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": {
      "company_id": "<company_id>",
      "connection_id": "<connection_id>",
      "event_id": "<event_id>"
    },
    "name": "beel_discard_payment_event"
  }
}

Input 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?

Beyond the annotations (destructive=true, idempotent=true), the description discloses that this is a soft delete with the row preserved in the audit trail, that the operation cascades to every eligible event sharing the payment identity or source object, that all affected rows share a single transaction and one `deleted_at` timestamp, that ineligible and unprocessed RECEIVED events are left untouched, and that the response returns the named event. That is substantial behavioral detail an agent could not infer from the hints alone.

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?

It is front-loaded with the action and reversibility before the dense scope rules, and every clause carries operational meaning; nothing is filler. The middle paragraph is heavy with nested parentheticals, which slows parsing on a first read, but the complexity being described justifies the length.

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?

For a destructive, cascading mutation with no output schema, the description covers what is affected, what is preserved, transactional behavior, failure conditions, and what the response contains. An agent has everything needed to call it correctly and to anticipate the blast radius.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning: `event_id` is not merely the row removed — it is a selector whose payment identity or source object determines the full scope of the cascading discard. That reinterprets the most consequential parameter in a way the schema text does not.

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 first sentence names a specific verb and resource ('Removes a payment event from the default list (soft delete)') and immediately clarifies that it is reversible, which separates it from an ordinary delete. It also points at the restore counterpart, so an agent can distinguish it from beel_restore_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?

The description gives clear context for when the operation applies (removing events from the default list while retaining audit trail) and names the restore path for reversal, plus explicit conditions under which it fails: events linked to an issued invoice or currently processing return 400. It does not explicitly compare against other sibling event tools such as beel_resolve_payment_event or beel_retry_payment_event, which keeps it 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