Skip to main content
Glama

qrtap_set_smart_rules

Replace a QR code's Smart Links rules to route scans by device, language, or time window; unmatched scans fall back to the primary destination.

Instructions

REPLACE the Smart Links rules of one code — conditional redirects evaluated on every scan, first match wins, falling back to the code's primary destination when nothing matches. Typical uses: send iOS and Android scans to their own app stores, serve a Russian and a Kyrgyz page, or point at the delivery menu outside opening hours. The array you pass becomes the complete rule set, so read the current one with qrtap_get_smart_rules first; passing [] clears all rules. At most 5 rules.

Input Schema

NameRequiredDescriptionDefault
rulesYesThe complete new rule set, max 5, evaluated top to bottom. Each rule is {"if": <condition>, "to": "<http/https url>"}. Pass [] to remove every rule.
codeIdYesThe code id (UUID), as returned by qrtap_create_code, qrtap_create_codes_bulk or qrtap_list_codes. This is the internal id, not the short_url slug.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.4

TDQS

A4.6/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 most of it: it discloses that the passed array wholesale replaces the existing set, that [] destroys all rules, that evaluation is top-to-bottom with first match winning, and that nothing matching falls back to the primary destination. It stops short of stating permission requirements, error behavior, or what a successful call returns.

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

Conciseness5/5

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

Every sentence earns its place: REPLACE is front-loaded, the semantics follow, then use cases, then the read-first instruction and clear behavior. No filler or redundancy despite reasonable length.

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?

For a destructive batch-mutation tool with no annotations and no output schema, the description covers semantics, limits, ordering, and clearing behavior well. It could still say what the caller gets back on success or what happens on invalid conditions, but an agent has enough to call it correctly.

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 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: the replace-versus-merge semantics, the clearing behavior of an empty array, and the top-to-bottom evaluation order of the array. The 5-rule cap merely restates maxItems.

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

Purpose5/5

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

The description names a specific verb (REPLACE) and resource (Smart Links rules of one code), then defines what those rules are: conditional redirects evaluated on every scan with first-match-wins and fallback to the primary destination. It is clearly distinguished from its read counterpart qrtap_get_smart_rules and from the simpler qrtap_change_destination.

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

Usage Guidelines5/5

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

It states concrete when-to-use scenarios (iOS/Android app store routing, per-language pages, off-hours menu) and an explicit prerequisite: read the current set with qrtap_get_smart_rules before replacing it. The relationship to the alternative tool is spelled out rather than inferred.

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