upsert_relationship
Create or update ERD relationships between entities, specifying cardinality, foreign key referential actions, and constraint names.
Instructions
Creates a relationship (no relationshipId, source/targetEntityId required — FKs derived automatically) or updates one (relationshipId given). On update, sourceEnd/targetEnd take precedence; otherwise ends are re-derived from cardinality. onDelete/onUpdate set the FK referential actions ('noAction' reverts to the DB default); constraintName sets the FK constraint name (empty string reverts to auto-generation).
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": {
"source": "<source>"
},
"name": "upsert_relationship"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Target ERD — exactly one of a local file ({file}) or a server ERD ({erdId}) | |
| onDelete | No | ||
| onUpdate | No | ||
| sourceEnd | No | ||
| targetEnd | No | ||
| cardinality | No | ||
| constraintName | No | ||
| relationshipId | No | ||
| sourceEntityId | No | ||
| targetEntityId | No | ||
| relationshipType | No |