add_feature_value
Add feature values (terms or asset RIDs) to domain records in one batch. Handles simple single-value features and records provenance for auditability.
Instructions
Add feature values to one or more domain objects.
Associates feature values (terms, assets, or other) with target records. Accepts a list of entries, each mapping a target RID to a value. All entries are inserted in a single batch for efficiency.
If an execution is active, it will be used for provenance. Otherwise, provide an execution_rid explicitly.
For simple features (single term or asset column):
Use this tool — each entry needs only target_rid and value.
For complex features (multiple columns per record):
Use add_feature_value_record instead, which accepts arbitrary field dicts.
Args: table_name: Table the target records belong to (e.g., "Image"). feature_name: Name of the feature (e.g., "Diagnosis"). entries: List of dicts, each with: - target_rid (str): RID of the target record to annotate. - value (str): The feature value — a term name or asset RID. execution_rid: Execution RID for provenance (uses active if not provided).
Returns: JSON with status, feature_name, count, execution_rid, rids.
Examples: # Single value add_feature_value("Image", "Diagnosis", [{"target_rid": "1-ABC", "value": "Normal"}])
# Batch values
add_feature_value("Image", "Diagnosis", [
{"target_rid": "1-ABC", "value": "Normal"},
{"target_rid": "1-DEF", "value": "Abnormal"},
{"target_rid": "1-GHI", "value": "Normal"},
])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entries | Yes | ||
| table_name | Yes | ||
| feature_name | Yes | ||
| execution_rid | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |