Skip to main content
Glama

upsert_preset

Create or replace a validated Tuya or Smart Life lighting preset for a single setting or multi-target scene, so saved configurations can be reused without cloud dependence.

Instructions

Create or replace a preset. The config is validated before saving.

Single setting: {"temp": 20, "brightness": 50, "description": "optional"} {"rgb": [255, 0, 128], "brightness": 80} Scene: {"targets": {"ceiling": {"on": false}, "setup": {"rgb": [255, 0, 128], "brightness": 80}, "bed": {"temp": 0, "brightness": 15}}} Keys per setting: on, brightness (1-100), temp (0-100), rgb. temp and rgb are exclusive.

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": {
      "name": "<name>",
      "config": "<config>"
    },
    "name": "upsert_preset"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses that config is validated before saving and that the operation replaces an existing preset rather than only creating one. It omits what a replace does to unspecified keys (merge vs. full overwrite) and any permission or failure behavior, which keeps it from a 5.

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?

The behavioral rule is front-loaded in the first line, followed by tightly formatted examples that an agent can copy directly; the range and exclusivity constraints are compressed into a single closing line. The aligned example table is slightly wide but each line carries distinct information.

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

Completeness3/5

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

For a mutation tool with a nested free-form object and no annotations or output schema, the config side is well covered, but the description says nothing about the return value or the semantics of `name`. An agent can construct a call but cannot predict the response or the identity behavior of the preset.

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

Parameters4/5

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

Schema coverage is 0% and the config object is opaque (additionalProperties: true), so the description must compensate — and it largely does, supplying two worked examples, a scene shape with nested targets, the allowed keys, the brightness/temp ranges, and the temp-vs-rgb exclusivity rule. The required `name` parameter is never explained (uniqueness, matching, case sensitivity), which is the one clear gap.

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?

The description opens with a specific verb+resource combination, "Create or replace a preset," which makes the upsert semantics explicit and distinguishes it from delete_preset and get_presets. It stops short of naming those siblings or stating what presets are used for, so it is clear but not maximally differentiated.

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

Usage Guidelines2/5

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

There is no when-to-use guidance: nothing says to prefer this over set_light for direct application, nor that get_presets/delete_preset handle retrieval and removal. The agent must infer the workflow context entirely from the tool name.

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