Create Data Type
create_data_typeDefine a custom data type to track new events or metrics with your own fields, so you can record and organize personalized data in Fulcra.
Instructions
Create a user-defined data type so the user can track something new.
For new tracking prefer base_type "event" (something that happens, at a time or over a range) or "metric" (a measured number); both can add custom fields. The older annotation bases "moment", "duration", "boolean", "numeric" and "scale" (a 1-5 rating) still work but take no fields.
Record with record_data (custom fields go in its fields);
get_data_catalog(data_type=) lists a type's fields; get_records reads
it back. Reversible with archive_data_type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable name (e.g. "Caffeine Intake"). | |
| tags | No | Tag names to attach; missing tags are created. Annotation bases only. | |
| unit | No | Unit for recorded values (e.g. "mg"). metric/numeric only. | |
| scale | No | Value range, {"min": 1, "max": 10, "step": 1}. metric only. | |
| fields | No | JSON Schema of custom fields. event/metric only. E.g. {"properties": {"mood": {"type": "string"}}, "required": ["mood"]}. | |
| base_type | Yes | What kind of values this type records (see above). | |
| value_map | No | Labels for values, e.g. {"1": "low", "5": "high"}. metric only. | |
| description | No | What the type tracks. Required for event/metric. | |
| metric_kind | No | "cumulative" or "discrete". metric/boolean/numeric/scale only. | |
| scale_labels | No | Exactly 5 labels for the 1-5 scale values. scale only. | |
| default_value | No | Value pre-filled when recording. boolean/numeric only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |