Skip to main content
Glama

Create or update a preference

define_preference
DestructiveIdempotent

Create 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

NameRequiredDescriptionDefault
keyYesthe key as <space>.<name> in lower snake case, such as media.watched_movies; the space is created if needed
nameNoa short human name; made from the key when creating without one, and kept when updating without one
typeYestoggle, text, number, choice, time_rule, list or detail_list
valueNothe 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
configNochoice: {options:[...]}; number: {unit,min,max}; toggle: {on_means,off_means}; list: {item_kind}; detail_list: {columns:[{id,type:text|number|rating|date,name,max}]}
reasonNowhy the preference is being defined, usually what the user said
aliasesNotwo 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
descriptionYesone or two sentences telling agents what the value means and how to act on it

Output Schema

NameRequiredDescriptionDefault
createdYesfalse when the key already existed and only its definition or value changed
pendingNoset when the change waits for the user's approval
preferenceNothe setting as stored
dropped_valuesNohow many items lost a value to a removed column

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, idempotentHint=true and destructiveHint=true, and the description reinforces idempotency by explaining that re-defining a key updates rather than duplicates it. It adds useful mechanics (type is fixed, omitted name/config/aliases are preserved, no restart needed, space auto-created). However, for a tool flagged destructive it never says what is lost when a config change drops columns or options, or what happens to stored values that no longer fit — a notable gap given the destructive flag.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose, then the usage condition, then creation rules, then update rules — a logical order for an upsert tool. Sentences are dense but each carries information; minor redundancy with the schema on value requirements and alias counts.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return values need not be described, and the description covers the hard parts of an 8-parameter nested-upsert tool: key format, type immutability, partial-update semantics and compatible config evolution. The remaining gap is error/edge behavior on incompatible redefinitions and how it relates to sibling mutation tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents key format, alias replacement rules, per-type value requirements and the config shape, so the description largely restates structured data. Its one genuine addition is the rationale for aliases (search matches name, aliases and description) and the create-vs-update rule for omitted fields. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Create a preference") plus the upsert twist ("Define the key again to update it"), so the agent knows this handles both create and update of a namespaced key. It never names or contrasts any sibling such as set_preferences or search_preferences, which is the only thing keeping it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a real selection condition: "Use it when the user wants to record something no existing key covers." It also explains the update path clearly. It stops short of explicit exclusions or naming the alternative tool to use when a key already exists or when the user merely wants to read/search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources