create_association
Define a relationship between two Huly classes by specifying roles and cardinality. Idempotently creates the association or returns the existing one.
Instructions
Idempotently create one Huly association definition between two non-system classes. Use sourceClass/targetClass with sourceRole/targetRole and cardinality; returns an existing identical association by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourceClass | Yes | a string that will be trimmed | |
| targetClass | Yes | a string that will be trimmed | |
| sourceRole | Yes | a string that will be trimmed | |
| targetRole | Yes | a string that will be trimmed | |
| cardinality | Yes | Association cardinality: one-to-one, one-to-many, many-to-many | |
| automationOnly | No | Whether Huly automation-only UI paths should own relation writes for this association. Defaults to false. | |
| ifExists | No | return_existing (default) returns an identical existing association; fail reports an existing association as an error |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | The successful tool result. The same value is also serialized as JSON in the text content for clients that do not read structuredContent. | |
| warnings | No | Optional agent-visible warnings about degraded result fidelity. Omitted when the server returned the documented happy-path payload. |