Skip to main content
Glama
benswel

QR for Agent

update_qr_destination

Change where an existing QR code redirects without regenerating the image. Update campaigns, fix broken links, or run A/B tests by modifying the destination URL.

Instructions

Change where an existing QR code redirects to. This is the key 'dynamic link' feature: the QR image stays the same, but scanning it will now go to the new URL. Ideal for updating campaigns, fixing broken links, or A/B testing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_idYesThe short ID of the QR code to update.
target_urlYesThe new destination URL.
labelNoOptionally update the label too.
expires_atNoISO 8601 expiration date. Set to null to remove expiration.
scheduled_urlNoScheduled replacement URL. Set to null to cancel.
scheduled_atNoISO 8601 activation date for scheduled_url. Set to null to cancel.
gtm_container_idNoGoogle Tag Manager container ID. Set to null to remove GTM tracking.

Implementation Reference

  • The handler function for 'update_qr_destination' performs a PATCH request to the API with the provided QR code details.
    handler: async (input: { short_id: string; target_url: string; label?: string; expires_at?: string | null; scheduled_url?: string | null; scheduled_at?: string | null; gtm_container_id?: string | null }) => {
      const body: Record<string, unknown> = { target_url: input.target_url, label: input.label };
      if (input.expires_at !== undefined) body.expires_at = input.expires_at;
      if (input.scheduled_url !== undefined) body.scheduled_url = input.scheduled_url;
      if (input.scheduled_at !== undefined) body.scheduled_at = input.scheduled_at;
      if (input.gtm_container_id !== undefined) body.gtm_container_id = input.gtm_container_id;
      return apiRequest(`/api/qr/${input.short_id}`, {
        method: "PATCH",
        body,
      });
    },
  • Input schema for 'update_qr_destination' using Zod for validation.
    inputSchema: z.object({
      short_id: z.string().describe("The short ID of the QR code to update."),
      target_url: z
        .string()
        .url()
        .describe("The new destination URL."),
      label: z
        .string()
        .optional()
        .describe("Optionally update the label too."),
      expires_at: z
        .string()
        .nullable()
        .optional()
        .describe("ISO 8601 expiration date. Set to null to remove expiration."),
      scheduled_url: z
        .string()
        .url()
        .nullable()
        .optional()
        .describe("Scheduled replacement URL. Set to null to cancel."),
      scheduled_at: z
        .string()
        .nullable()
        .optional()
        .describe("ISO 8601 activation date for scheduled_url. Set to null to cancel."),
      gtm_container_id: z
        .string()
        .regex(/^GTM-[A-Z0-9]+$/)
        .nullable()
        .optional()
        .describe("Google Tag Manager container ID. Set to null to remove GTM tracking."),
    }),
  • Registration of the 'update_qr_destination' tool in the tools object.
    update_qr_destination: {
Behavior3/5

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

With no annotations provided, the description carries the full burden. It successfully explains the core behavioral trait (QR image persistence while changing destination) but fails to disclose mutation implications, validation rules, or side effects like whether old URLs are archived.

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?

Three well-structured sentences with zero waste: first establishes action, second explains mechanism, third provides use cases. Every sentence earns its place and follows front-loading best practices.

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

Completeness2/5

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

Despite 100% schema coverage, the description fails to acknowledge the tool's significant advanced capabilities—scheduling future URL changes (scheduled_url, scheduled_at), expiration management, and GTM integration—leaving agents unaware of these features unless they deeply inspect the schema.

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 description coverage is 100%, establishing a baseline of 3. The description implies 'short_id' and 'target_url' through references to 'existing QR code' and 'new URL', but adds no syntax guidance or semantic context beyond what the schema already provides for the other 5 parameters.

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 opens with a specific verb+resource ('Change where an existing QR code redirects to'), explains the mechanism ('the QR image stays the same'), and distinguishes from siblings by highlighting the 'dynamic link' feature versus creating new codes.

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

Usage Guidelines3/5

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

Provides concrete use cases ('updating campaigns, fixing broken links, or A/B testing') but lacks explicit when-to-use guidance versus siblings like bulk_update_qr_codes or the specialized update_app_store_qr/update_wifi_qr tools, and omits prerequisites like requiring an existing QR code.

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-agent-core'

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