Skip to main content
Glama
benswel

QR for Agent

create_location_qr

Generate a QR code that opens a specific map location when scanned. Encodes geographic coordinates for map apps to parse, enabling direct navigation.

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 for the create_location_qr tool. It extracts latitude, longitude, label, and qr_label from input, then sends a POST request to /api/qr with type 'location' and location_data containing the geographic coordinates.
    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 schema for create_location_qr, using Zod validation. Mandatory fields: latitude and longitude. Optional fields include label, qr_label, format (defaults to 'svg'), foreground_color, background_color, dot_style, corner_style, logo_url, frame_style, frame_text, frame_color, and frame_text_color with regex validation for hex colors.
    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."),
    }),
  • The tool registration entry in the tools object export from tools.ts. The key 'create_location_qr' is the tool name used by the MCP server registration loop in server.ts.
    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 },
        });
      },
    },
  • The apiRequest helper function used by the handler to make HTTP POST requests to /api/qr. It adds X-API-Key header, serializes the body as JSON, and returns the parsed JSON response.
    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();
    }
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It only mentions the output behavior (opens map location) but omits other aspects like idempotency, authentication, rate limits, or whether it modifies existing resources. This gap is significant for a tool with no annotations.

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 two sentences, no filler, and immediately conveys the core functionality. It is appropriately sized and efficiently communicates the 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?

Despite having 14 parameters (many optional), the description is extremely terse. It lacks information about what the tool returns (no output schema), how the QR code is delivered, or how the parameters affect the output. For a tool with this complexity, the description is incomplete.

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%, so the baseline is 3. The description adds a bit of context ('map apps can parse') but does not elaborate on parameter semantics beyond the schema. It meets the baseline but does not surpass it.

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 creates a QR code that opens a map location when scanned, and encodes geographic coordinates. This precisely identifies the tool's purpose and distinguishes it from siblings like create_email_qr or create_phone_qr.

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

Usage Guidelines2/5

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

No guidance is given on when to use this tool versus any of the many other QR creation tools. The description does not mention any prerequisites or alternatives, leaving the agent to infer usage context.

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