Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_upsert_custom_field

DestructiveIdempotent

Create or update a company custom field by key, keeping existing archive and suggestion settings when omitted. Repeat calls safely to seed a catalogue without undoing manual changes.

Instructions

Creates the custom field with this key, or updates it if the company already has one. Repeating the request leaves the same state, so it is safe to run on every deployment to seed a catalogue.

  • Status: 201 when the field is created, 200 when it already existed.

  • Key: it is the path, never the body, and it never changes. To stop using a field, archive it (is_archived: true); fields are never deleted.

  • Archive state: omitting is_archived keeps the current one, so repeating the request never reactivates a field someone archived.

  • Suggestions: omitting suggest_values keeps the current setting; a new field starts with true. Use false for a value that changes on every invoice, such as an order number: invoices store the text as sent and no options are created. Turning it off deletes no option, and turning it back on offers them again.

  • Options: the response carries the common options of the field, or none when suggest_values is false.

BeeL API endpoint: PUT /v1/companies/{company_id}/custom-fields/{key} (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>",
      "key": "<key>",
      "body": "<body>"
    },
    "name": "beel_upsert_custom_field"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKey of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`.
bodyYes
company_idYesUnique identifier (UUID) of the company the operation acts on — 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.12.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag idempotentHint=true and destructiveHint=true, and the description adds real context beyond them: exact status codes (201 create / 200 existed), the fact that fields are archived and never deleted, that omitting `is_archived` never reactivates an archived field, and that omitting `suggest_values` preserves the current setting. That last point resolves a genuine ambiguity for a destructive-flagged tool — repeating a call cannot silently undo someone else's change.

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 lead sentence carries the core semantics before any decoration, and the bold-labelled bullets (Status, Key, Archive state, Suggestions, Options) let an agent scan to the relevant clause quickly. It is fairly long and a couple of bullets duplicate the embedded schema text, so not maximally tight.

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 3-parameter mutation with a nested body and no output schema, the description covers what an agent needs: error/status behavior, immutability of the key, the archive-instead-of-delete lifecycle, and what the response contains regarding options. Nothing material is left to inference.

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 67% and the description fills the important gaps: the key lives in the path, never the body, and never changes; `suggest_values` defaults to true only on creation and turning it off deletes no options; `label` and `show_on_pdf` are always replaced. Some of this restates the schema's own `UpsertCustomFieldRequest` description, which holds it below a 5.

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 opening sentence gives a specific verb pair plus resource and states the conditional upsert semantics explicitly: 'Creates the custom field with this `key`, or updates it if the company already has one.' That is enough for an agent to distinguish this PUT-based upsert from the option-level and read siblings without opening any 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?

It gives a concrete usage context — 'safe to run on every deployment to seed a catalogue' — which tells an agent when this is the right choice over a read or a per-option tool. It does not name a specific alternative or state when *not* to use it, so it stops short of full routing guidance.

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