Skip to main content
Glama

add_relation

Creates ONE relation between two entities. The source field has to be of type 'reference'. The cardinality (crow's foot) is specified on each end — by default 'many' on the FK side, 'one' on the target side. Several relations: add_relations_batch places them in 1 call.

Input Schema

NameRequiredDescriptionDefault
idYesUnique ID of the relation
labelNo
onDeleteNo
onUpdateNo
toCellIdYesID of the target entity
toFieldIdYesID of the target field (typically the PK)
fromCellIdYesID of the source entity (FK side)
fromFieldIdYesID of the FK field (must be of type reference)
cardinalityToYesCardinality on the target side
cardinalityFromYesCardinality on the source side
expectedProjectIdNoUUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / cardinalityFrom / description
      Previous value: -"Cardinalité côté source"New value: +"Cardinality on the source side"
    • changedInput schema / properties / cardinalityTo / description
      Previous value: -"Cardinalité côté cible"New value: +"Cardinality on the target side"
    • changedInput schema / properties / expectedProjectId / description
      Previous value: -"UUID du projet visé par CET appel. Cible RÉELLEMENT ce projet au lieu du projet de session. Refusé sans rien modifier si l'accès n'est pas accordé."New value: +"UUID of the project targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted."
    • changedInput schema / properties / fromCellId / description
      Previous value: -"ID de l'entité source (côté FK)"New value: +"ID of the source entity (FK side)"
    • changedInput schema / properties / fromFieldId / description
      Previous value: -"ID du champ FK (doit être de type reference)"New value: +"ID of the FK field (must be of type reference)"
    • changedInput schema / properties / id / description
      Previous value: -"ID unique de la relation"New value: +"Unique ID of the relation"
    • changedInput schema / properties / toCellId / description
      Previous value: -"ID de l'entité cible"New value: +"ID of the target entity"
    • changedInput schema / properties / toFieldId / description
      Previous value: -"ID du champ cible (typiquement la PK)"New value: +"ID of the target field (typically the PK)"
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world mutation. The description adds real behavior beyond that: the default cardinality ('many' on the FK side, 'one' on the target side) and the reference-type requirement on the source field. It does not, however, explain the referential-action semantics of onDelete/onUpdate.

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?

Three tightly-packed sentences, zero waste, with the core verb and the batch alternative both front-loaded. No filler.

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?

For an 11-parameter mutation with no output schema, the description covers the essential creation semantics and defaults but omits the referential actions (cascade/restrict/set_null/no_action) that are central to a relation, and the project-targeting behaviour of expectedProjectId. Adequate but with clear gaps.

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 73%, so the schema already documents most parameters (toCellId, fromCellId, cardinals). The description reinforces the source-FK/reference constraint but says nothing about label, onDelete, onUpdate, or expectedProjectId, which lack schema descriptions. Baseline 3 is appropriate for this coverage level.

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?

Specific verb+resource ('Creates ONE relation between two entities'), with the singular 'ONE' capitalised to distinguish it from the batch sibling. It also states the key precondition (source field must be of type 'reference'). An agent can identify the tool's job without opening the schema.

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?

Explicitly routes to the alternative: 'Several relations: add_relations_batch places them in 1 call.' This names the sibling and the condition that selects it, and the reference-type prerequisite is also given up front. Nothing is left to inference for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.