apply_structure
Add parent → child relations between names. Idempotent: existing links stay; new ones are added. With createMissing=true (default) names are auto-created if not found. Returns: applied, alreadyLinked, namesCreated (the names that didn't exist before), namesResolved (every child in input order with its resolved id — use to chain into edit_name_attributes).
═══ PROVENANCE — required on every write ═══ source: origin reference (file/URL/document/short note). Lands in the audit trail. agent: your AI agent name (e.g. "Claude"). Lands in the audit trail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | Yes | AI agent name (e.g. "Claude"). REQUIRED. | |
| source | Yes | Origin reference — file, URL, document, or short note. REQUIRED. | |
| database | Yes | Database name | |
| relations | Yes | Non-empty array of {parent, child} pairs | |
| createMissing | No | Auto-create names that don't exist (default: true) |