Skip to main content
Glama
benswel

QR for Agent

get_qr_analytics

Analyze QR code performance by tracking scan metrics, trends, device breakdowns, geographic data, and recent scan events to measure engagement.

Instructions

Get enriched scan analytics for a QR code. Returns total scans, daily trends, device/browser/country/referer breakdowns with percentages, and recent scan events with parsed user-agent and geo data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_idYesThe short ID of the QR code to get analytics for.
periodNoTime period for aggregations. Default: 30d.30d

Implementation Reference

  • Definition and handler implementation of the 'get_qr_analytics' tool.
    get_qr_analytics: {
      description:
        "Get enriched scan analytics for a QR code. Returns total scans, daily trends, device/browser/country/referer breakdowns with percentages, and recent scan events with parsed user-agent and geo data.",
      inputSchema: z.object({
        short_id: z.string().describe("The short ID of the QR code to get analytics for."),
        period: z
          .enum(["7d", "30d", "90d", "all"])
          .default("30d")
          .describe("Time period for aggregations. Default: 30d."),
      }),
      handler: async (input: { short_id: string; period: string }) => {
        return apiRequest(`/api/analytics/${input.short_id}`, { query: { period: input.period } });
      },
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden and compensates well by detailing the complete response structure (total scans, trends, breakdowns, recent events). However, it omits explicit read-only safety confirmation, rate limits, or whether data is real-time versus cached.

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 well-structured sentences with zero waste. The first states purpose; the second justifies the 'enriched' claim by listing specific return data points. Given the absence of an output schema, the enumeration of return fields is necessary and appropriately detailed.

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 2-parameter tool with 100% schema coverage and no output schema, the description is nearly complete. It effectively compensates for the missing output schema by detailing return values. Minor gap remains regarding differentiation from sibling analytics endpoints (get_usage, get_conversions).

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%, clearly documenting both short_id and period with defaults/enums. The description mentions analytics 'for a QR code' implicitly referencing short_id, but adds no semantic meaning beyond the schema (e.g., short_id format expectations, how period affects trend granularity).

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 the specific verb 'Get' and resource 'enriched scan analytics for a QR code', clearly distinguishing it from sibling creation/management tools like create_qr_code or update_qr_destination. The scope is precisely defined through the enumeration of analytics types returned.

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?

While the implied usage is clear (retrieve scan statistics), the description provides no explicit guidance on when to choose this over sibling analytics tools like get_conversions, get_usage, or get_qr_code. No prerequisites or exclusion criteria are mentioned.

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