Skip to main content
Glama
benswel

QR for Agent

update_app_store_qr

Update the app store URLs of an existing App Store QR code by providing its short ID and optionally new iOS, Android, or fallback URLs. Partial updates merge with current data without regenerating the QR image.

Instructions

Update the app store URLs of an App Store QR code. Partial updates merge with existing data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_idYesThe short ID of the App Store QR code to update.
ios_urlNoApple App Store URL.
android_urlNoGoogle Play Store URL.
fallback_urlNoFallback URL.
labelNoUpdate the label.

Implementation Reference

  • Handler function that destructures input to extract short_id and label, wraps remaining fields in app_store_data, and sends a PATCH request to /api/qr/{short_id}.
    handler: async (input: Record<string, unknown>) => {
      const { short_id, label, ...appStoreFields } = input;
      const body: Record<string, unknown> = { app_store_data: appStoreFields };
      if (label !== undefined) body.label = label;
      return apiRequest(`/api/qr/${short_id}`, { method: "PATCH", body });
    },
  • Input schema using Zod: requires short_id, optional ios_url, android_url, fallback_url, and label.
    inputSchema: z.object({
      short_id: z.string().describe("The short ID of the App Store QR code to update."),
      ios_url: z.string().optional().describe("Apple App Store URL."),
      android_url: z.string().optional().describe("Google Play Store URL."),
      fallback_url: z.string().optional().describe("Fallback URL."),
      label: z.string().optional().describe("Update the label."),
    }),
  • Tool definition registered as a property of the `tools` object exported from tools.ts.
    update_app_store_qr: {
      description:
        "Update the app store URLs of an App Store QR code. Partial updates merge with existing data.",
      inputSchema: z.object({
        short_id: z.string().describe("The short ID of the App Store QR code to update."),
        ios_url: z.string().optional().describe("Apple App Store URL."),
        android_url: z.string().optional().describe("Google Play Store URL."),
        fallback_url: z.string().optional().describe("Fallback URL."),
        label: z.string().optional().describe("Update the label."),
      }),
      handler: async (input: Record<string, unknown>) => {
        const { short_id, label, ...appStoreFields } = input;
        const body: Record<string, unknown> = { app_store_data: appStoreFields };
        if (label !== undefined) body.label = label;
        return apiRequest(`/api/qr/${short_id}`, { method: "PATCH", body });
      },
    },
  • Helper function that makes HTTP requests to the backend API with X-API-Key authentication.
    export async function apiRequest(path: string, options: RequestOptions = {}) {
      const { method = "GET", body, query } = options;
    
      let url = `${BASE_URL}${path}`;
      if (query) {
        const params = new URLSearchParams();
        for (const [key, value] of Object.entries(query)) {
          params.set(key, String(value));
        }
        url += `?${params.toString()}`;
      }
    
      const headers: Record<string, string> = {
        "X-API-Key": API_KEY,
      };
    
      if (body) {
        headers["Content-Type"] = "application/json";
      }
    
      const res = await fetch(url, {
        method,
        headers,
        body: body ? JSON.stringify(body) : undefined,
      });
    
      return res.json();
    }
Behavior3/5

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

The description adds behavioral context by noting 'Partial updates merge with existing data', which is useful. However, without annotations, it lacks transparency on permissions, idempotency, side effects, or error conditions.

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?

The description is concise (two sentences) with the purpose front-loaded, followed by a key behavioral detail. No extraneous information.

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 tool with moderate complexity (5 params, no output schema), the description is mostly complete. It explains the update and partial merge. Could mention return value or default behavior, but overall adequate.

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?

The input schema has 100% description coverage, so the schema already documents parameters. The description adds value by explaining the merge behavior, which clarifies that omitted fields are not cleared. This exceeds the baseline of 3.

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 clearly states the verb 'Update' and the resource 'App Store QR code', specifying that it updates app store URLs. It distinguishes itself from siblings like 'create_app_store_qr' by implying an existing code and from 'update_qr_destination' by targeting a specific QR type.

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?

The description implies usage when modifying an existing App Store QR's URLs but does not explicitly state when to use this tool over alternatives like 'update_qr_destination' or other update tools. No exclusions or sibling references are provided.

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