Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_initiate_payment_connection

Idempotent

Opens a payment-provider authorization session for a managed company holder, returning the URL where they can connect Stripe and finalize the connection.

Instructions

Opens an authorization session so the holder of a company your account manages can connect a payment provider (stripe), and returns the authorization_url where they authorize it.

  • return_url: once the holder authorizes, BeeL's callback finalizes the connection and redirects back to the return_url of your portal, if you supplied one, with the parameters described under return_url.

  • When the connection appears: it is created only when the holder authorizes, so it does not appear in GET /v1/companies/{company_id}/payment-connections until then. It is sealed under the NIF in the path, so auto-invoicing issues under that NIF.

  • The NIF must be activated in the mode of your API key (beel_sk_test_* → Test, beel_sk_live_* → Live); otherwise the request answers 400 COMPANY_NOT_ACTIVATED_IN_ENVIRONMENT and no authorization_url is issued, because without activation there is no invoice series or tax configuration to invoice with. Test and Live activations are independent — a NIF activated in one mode still needs activating in the other.

  • One provider account, one NIF: a provider account (acct_...) can be connected to a single NIF across the whole platform. Authorizing the same provider account from a second NIF does not move it: the callback fails with OAUTH_ACCOUNT_CONNECTED_TO_OTHER_COMPANY, and the existing connection keeps invoicing under the NIF it was sealed with. To move it, first DELETE /v1/companies/{company_id}/payment-connections/{connection_id} on the NIF that holds it, then open a new authorization on the NIF you want it under.

BeeL API endpoint: POST /v1/companies/{company_id}/payment-connections/authorizations (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>",
      "body": "<body>"
    },
    "name": "beel_initiate_payment_connection"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
company_idYesUnique identifier (UUID) of the company the authorization is opened for — 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.
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. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / body / type
      Added value: +"object"
  2. Changed6 schema fields changedv0.5.0
    • addedInput schema / $defs / InitiatePaymentConnectionRequest / additionalProperties
      Added value: +false
    • removedInput schema / $defs / InitiatePaymentConnectionRequest / properties / provider / example
      Removed value: -"stripe"
    • changedInput schema / $defs / InitiatePaymentConnectionRequest / properties / return_url / description
      Previous value: -"URL of your portal to redirect the account holder back to after the OAuth callback\ncompletes. Must be an absolute `https://` URL. On **success** BeeL appends\n`status=success`, `provider` (slug), `company_id`, `connection_id` and `account`\n(the provider account id, e.g. `acct_...`). On **error** it appends `status=error`,\n`provider` and `message`, always a stable uppercase error code: `OAUTH_STATE_INVALID`\n(the authorization is unknown, expired or already used), `OAUTH_TOKEN_EXCHANGE_FAILED`\n(the provider rejected the code exchange), `ACCESS_DENIED` (the account holder declined\nat the provider), `PROVIDER_ERROR` (any other provider-reported failure) or\n`OAUTH_UNEXPECTED`. When omitted, or when the URL is not a valid absolute `https://`\nURL, the callback redirects to BeeL's default integrations screen.\n"New value: +"URL of your portal to redirect the account holder back to after the OAuth callback\ncompletes. Must be an absolute `https://` URL. On **success** BeeL appends\n`status=success`, `provider` (slug), `company_id`, `connection_id` and `account`\n(the provider account id, e.g. `acct_...`). On **error** it appends `status=error`,\n`provider` and `message`, always a stable uppercase error code: `OAUTH_STATE_INVALID`\n(the authorization is unknown, expired or already used), `OAUTH_TOKEN_EXCHANGE_FAILED`\n(the provider rejected the code exchange), `ACCESS_DENIED` (the account holder declined\nat the provider), `OAUTH_ACCOUNT_CONNECTED_TO_OTHER_COMPANY` (the provider account is\nalready connected to another NIF; disconnect it there first),\n`PROVIDER_ERROR` (any other provider-reported failure) or\n`OAUTH_UNEXPECTED`. When omitted, the callback redirects to BeeL's default integrations\nscreen. A `return_url` that is not an absolute `https://` URL with a host is rejected\nup front with `422` `PAYMENT_RETURN_URL_INVALID`, and no authorization is opened.\n"
    • removedInput schema / $defs / InitiatePaymentConnectionRequest / properties / return_url / example
      Removed value: -"https://your-platform.example.com/connections/stripe/return"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / company_id / description
      Previous value: -"NIF (company) the authorization is opened for. 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."New value: +"Unique identifier (UUID) of the company the authorization is opened for — 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."
  3. First observedv0.3.1

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already disclose the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=true, openWorldHint=false), and the description adds substantial context beyond them: the resource is only created after the holder authorizes, the NIF/Test-vs-Live activation rule, and the one-provider-account-per-NIF constraint with its OAUTH_ACCOUNT_CONNECTED_TO_OTHER_COMPANY failure. It does not, however, describe the response payload beyond `authorization_url`, expiry of the session, or auth requirements for calling it, so with annotations carrying part of the load this lands at adequate-plus rather than exceptional. The disclosure is real but incomplete at the edges.

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?

The core action and return value are front-loaded in the opening sentence, with secondary constraints organized as bolded bullets that are easy to scan. Some content is duplicated from the input schema (the OAUTH_ACCOUNT_CONNECTED_TO_OTHER_COMPANY error code and the return_url redirect behavior), which costs a point on economy.

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?

With no output schema, the description carries the return-value burden and does so (`authorization_url`), and it covers the prerequisites, environment/activation rule, cross-company uniqueness constraint, and the error codes an agent may hit with no URL issued. For a three-parameter state-creating operation with a nested body, nothing an agent needs before calling is missing.

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 coverage is 67% and the schema descriptions are already exhaustive — provider slugs and 422 behavior, the full success/error callback parameter list, and the idempotency-key derivation/collapse semantics are all spelled out there. The description's `return_url` bullet largely restates the callback behavior already in the schema, and it adds nothing about `company_id` or `idempotency_key`, so the value added beyond structured fields is marginal.

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 states a specific verb and resource ('opens an authorization session ... to connect a payment provider (`stripe`)') and names the return value (`authorization_url`). It also draws the boundary against the sibling list endpoint, noting the connection does not appear in GET /v1/companies/{company_id}/payment-connections until the holder authorizes.

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?

It gives an explicit precondition (the NIF must be activated in the API key's mode, otherwise 400 COMPANY_NOT_ACTIVATED_IN_ENVIRONMENT and no URL is issued) and an explicit remediation path when a provider account is already bound elsewhere: DELETE the existing payment connection first, then open a new authorization. That is a full when/when-not plus alternative workflow.

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