next_free_id
Reserve the next unallocated switch, variable, or common-event ID to prevent collisions when multiple sessions edit the same project. Suggest IDs read-only; optionally fill gaps below the highest used.
Instructions
Reserve the next unallocated switch / variable / common-event ID(s) instead of picking one by hand. Ids are handed out strictly above every id already declared or referenced, so two sessions editing the same project over time cannot silently claim the same switch — a collision that never crashes and only surfaces hours into a playtest as a door that is inexplicably already open. Pass reuseGaps: true to fill holes below the highest id first (off by default: a hole is often an id claimed in notes but not yet written). Read-only — it suggests ids, it does not write them; name what you take with set_switch_name / set_variable_name so the next session sees the claim.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Which id namespace: switch, variable, or common_event. Database rows (actors, items, …) are not here — create_*/batch_create assign those ids, and list_names shows what exists. | |
| count | No | How many consecutive free ids to return (default 1) | |
| reuseGaps | No | Fill unallocated holes below the highest id first (default false) |