Skip to main content
Glama
benswel

QR for Agent

create_location_qr

Generate QR codes that open geographic coordinates in map applications when scanned, allowing users to share locations with customizable visual styles.

Instructions

Create a QR code that opens a map location when scanned. Encodes geographic coordinates that map apps can parse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latitudeYesGeographic latitude (-90 to 90).
longitudeYesGeographic longitude (-180 to 180).
labelNoHuman-readable place name (shown on map).
qr_labelNoLabel for this QR code (internal).
formatNoImage format.svg
foreground_colorNoHex color for dots.
background_colorNoHex color for background.
dot_styleNoDot shape.
corner_styleNoCorner shape.
logo_urlNoLogo URL or data URI.
frame_styleNoFrame style around QR.
frame_textNoCTA text on frame (max 30 chars).
frame_colorNoFrame background color.
frame_text_colorNoFrame text color.

Implementation Reference

  • The handler function that creates the location QR code by calling the /api/qr endpoint.
    handler: async (input: Record<string, unknown>) => {
      const { latitude, longitude, label, qr_label, ...rest } = input;
      return apiRequest("/api/qr", {
        method: "POST",
        body: { type: "location", location_data: { latitude, longitude, label }, label: qr_label, ...rest },
      });
    },
  • The input validation schema for the create_location_qr tool.
    inputSchema: z.object({
      latitude: z.number().min(-90).max(90).describe("Geographic latitude (-90 to 90)."),
      longitude: z.number().min(-180).max(180).describe("Geographic longitude (-180 to 180)."),
      label: z.string().optional().describe("Human-readable place name (shown on map)."),
      qr_label: z.string().optional().describe("Label for this QR code (internal)."),
      format: z.enum(["svg", "png"]).default("svg").describe("Image format."),
      foreground_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for dots."),
      background_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for background."),
      dot_style: z.enum(["square", "rounded", "dots", "classy-rounded"]).optional().describe("Dot shape."),
      corner_style: z.enum(["square", "extra-rounded", "dot"]).optional().describe("Corner shape."),
      logo_url: z.string().optional().describe("Logo URL or data URI."),
      frame_style: z.enum(["none", "banner_bottom", "banner_top", "rounded"]).optional().describe("Frame style around QR."),
      frame_text: z.string().max(30).optional().describe("CTA text on frame (max 30 chars)."),
      frame_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame background color."),
      frame_text_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame text color."),
    }),
  • Definition and registration of the create_location_qr tool.
    create_location_qr: {
      description:
        "Create a QR code that opens a map location when scanned. Encodes geographic coordinates that map apps can parse.",
      inputSchema: z.object({
        latitude: z.number().min(-90).max(90).describe("Geographic latitude (-90 to 90)."),
        longitude: z.number().min(-180).max(180).describe("Geographic longitude (-180 to 180)."),
        label: z.string().optional().describe("Human-readable place name (shown on map)."),
        qr_label: z.string().optional().describe("Label for this QR code (internal)."),
        format: z.enum(["svg", "png"]).default("svg").describe("Image format."),
        foreground_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for dots."),
        background_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Hex color for background."),
        dot_style: z.enum(["square", "rounded", "dots", "classy-rounded"]).optional().describe("Dot shape."),
        corner_style: z.enum(["square", "extra-rounded", "dot"]).optional().describe("Corner shape."),
        logo_url: z.string().optional().describe("Logo URL or data URI."),
        frame_style: z.enum(["none", "banner_bottom", "banner_top", "rounded"]).optional().describe("Frame style around QR."),
        frame_text: z.string().max(30).optional().describe("CTA text on frame (max 30 chars)."),
        frame_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame background color."),
        frame_text_color: z.string().regex(/^#[0-9A-Fa-f]{6}$/).optional().describe("Frame text color."),
      }),
      handler: async (input: Record<string, unknown>) => {
        const { latitude, longitude, label, qr_label, ...rest } = input;
        return apiRequest("/api/qr", {
          method: "POST",
          body: { type: "location", location_data: { latitude, longitude, label }, label: qr_label, ...rest },
        });
      },
    },
Behavior3/5

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

Explains user-facing behavior (QR opens map apps when scanned) but omits API operational details crucial given no annotations: whether the QR code is persisted to an account, idempotency behavior, return format (URL, image data, ID?), or rate limiting. Carries partial burden effectively but not fully.

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?

Two sentences with zero waste. First states core function; second clarifies technical mechanism. Appropriately sized for front-loading essential information.

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?

Inadequate for a 14-parameter tool with extensive customization options (dot_style, frame_style, colors). No output schema exists, yet description fails to specify return format or acknowledge the rich styling capabilities available. Should mention customization potential or distinguish from simpler alternatives.

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 baseline 3. Description implies coordinate requirements ('Encodes geographic coordinates') but adds no syntax details, formatting guidance, or explanation of styling capabilities (colors, frames, logos) available in the rich parameter set.

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 provides specific verb ('Create'), resource ('QR code'), and clear scope ('opens a map location', 'geographic coordinates'). Effectively distinguishes from siblings like create_email_qr or create_phone_qr through explicit geographic/map terminology.

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?

Implicitly guides selection by specifying map/location functionality, but lacks explicit when-to-use guidance versus generic create_qr_code or alternatives. No mention of prerequisites (e.g., coordinate source requirements) or when to prefer bulk_create_qr_codes.

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