Create or update a preference
define_preferenceCreate a preference so it can be stored and read from now on, without a restart. Use it when the user wants to record something no existing key covers. The key belongs to this user alone and its space is created if needed. Scalar types need a first value; lists start empty. Give it aliases, the other words the user might use for it, such as "films I've seen" for watched movies, since search finds a preference by its name, aliases and description. Define the key again to update it: the type is fixed, and a name, config or aliases omitted keep the current ones. A new config may add choice options or detail_list columns, rename columns or change a number's unit, as long as the current value still fits it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"key": "<key>",
"type": "<type>",
"description": "<description>"
},
"name": "define_preference"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | the key as <space>.<name> in lower snake case, such as media.watched_movies; the space is created if needed | |
| name | No | a short human name; made from the key when creating without one, and kept when updating without one | |
| type | Yes | toggle, text, number, choice, time_rule, list or detail_list | |
| value | No | the first value, required for toggle, text, number, choice and time_rule, and lists start empty: true or false for a toggle; a number; a string for text or one of a choice's options; or for a time_rule an object like the example | |
| config | No | choice: {options:[...]}; number: {unit,min,max}; toggle: {on_means,off_means}; list: {item_kind}; detail_list: {columns:[{id,type:text|number|rating|date,name,max}]} | |
| reason | No | why the preference is being defined, usually what the user said | |
| aliases | No | two to five other words or phrases the user might use for this preference, such as films I've seen or movie history for watched movies, so search finds it however it is asked for; when updating, these replace the current ones, an empty list removes them all, and leaving them out keeps them | |
| description | Yes | one or two sentences telling agents what the value means and how to act on it |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| created | Yes | false when the key already existed and only its definition or value changed | |
| pending | No | set when the change waits for the user's approval | |
| preference | No | the setting as stored | |
| dropped_values | No | how many items lost a value to a removed column |