Skip to main content
Glama
benswel

QR for Agent

set_redirect_rules

Set conditional redirect rules on a URL QR code to send users to different URLs based on device, OS, country, language, time range, or A/B split. Rules are evaluated top-down; first matching rule applies. Empty array clears all rules.

Instructions

Set conditional redirect rules on a URL QR code. Rules are evaluated top-to-bottom; each rule has an array of conditions (AND logic) — all must match. First matching rule's URL is used. If no rule matches, the default target_url applies. Conditions: 'device' (mobile/tablet/desktop), 'os' (iOS/Android/Windows/macOS/Linux), 'country' (ISO alpha-2 like 'FR'), 'language' (ISO 639-1 like 'fr'), 'time_range' ({start:'09:00',end:'17:00',timezone:'Europe/Paris'}), 'ab_split' ({percentage:50}). Combine conditions in a single rule for AND logic (e.g. mobile + FR). Pass an empty array to remove all rules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_idYesThe short ID of the QR code (must be type='url').
rulesYesArray of redirect rules. Empty array to clear all rules.
Behavior4/5

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

With no annotations, the description fully covers behavioral traits: top-to-bottom evaluation, AND logic per rule, fallback to default_url, and removal by empty array. No mention of side effects or permissions, but adequately transparent for the complexity.

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?

Description is well-structured with purpose first, then evaluation order, condition breakdown, and example. Sentences are mostly efficient, though could be slightly trimmed without losing clarity.

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?

Given the 2-param schema and no output schema, the description fully explains how to use the tool and the logic behind rules. It could mention that existing rules are overwritten, but this is implied by 'set'.

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%, but the description adds significant value by explaining condition types, value formats (e.g., 'FR' for country, object for time_range), and combinatory logic, making the parameters more meaningful.

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?

Description clearly states it sets conditional redirect rules on a URL QR code, explains evaluation order and AND logic, and distinguishes from siblings like set_utm_params or update_qr_destination by focusing on dynamic behavior.

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?

Provides explicit details on when to use (setting redirect rules), how rules are evaluated, and how to clear rules via empty array. Lacks explicit when-not-to-use, but the context is sufficiently clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/benswel/qr-for-agent-api'

If you have feedback or need assistance with the MCP directory API, please join our Discord server