Skip to main content
Glama
benswel

QR for Agent

bulk_delete_qr_codes

Remove multiple QR codes and their analytics simultaneously in one batch operation, handling up to 50 codes with individual error reporting for non-existent items.

Instructions

Delete multiple QR codes and their scan analytics in a single request (up to 50). Items with non-existent short_id are reported as not_found without failing the whole batch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
short_idsYesArray of short_id strings to delete. Max 50 per request.

Implementation Reference

  • The actual implementation of bulk_delete_qr_codes which iterates over short IDs, checks if they exist for the given API key, and deletes them from the database.
    export function bulkDeleteQrCodes(shortIds: string[], apiKeyId: number) {
      let deleted = 0;
      let notFound = 0;
      const results: Array<{ short_id: string; status: "deleted" | "not_found" }> = [];
    
      for (const shortId of shortIds) {
        const existing = db
          .select()
          .from(qrCodes)
          .where(and(eq(qrCodes.shortId, shortId), eq(qrCodes.apiKeyId, apiKeyId)))
          .get();
    
        if (!existing) {
          notFound++;
          results.push({ short_id: shortId, status: "not_found" });
          continue;
        }
    
        db.delete(qrCodes).where(eq(qrCodes.shortId, shortId)).run();
        deleted++;
        results.push({ short_id: shortId, status: "deleted" });
      }
    
      return { deleted, not_found: notFound, items: results };
    }
  • MCP tool registration for bulk_delete_qr_codes. It forwards the request to the /api/qr/bulk endpoint.
    bulk_delete_qr_codes: {
      description:
        "Delete multiple QR codes and their scan analytics in a single request (up to 50). Items with non-existent short_id are reported as not_found without failing the whole batch.",
      inputSchema: z.object({
        short_ids: z
          .array(z.string())
          .min(1)
          .max(50)
          .describe("Array of short_id strings to delete. Max 50 per request."),
      }),
      handler: async (input: Record<string, unknown>) => {
        return apiRequest("/api/qr/bulk", { method: "DELETE", body: input });
      },
    },
Behavior4/5

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

No annotations provided, so description carries full burden. It effectively discloses the cascading deletion of 'scan analytics' and the partial failure tolerance (non-existent IDs don't fail the batch). Missing irreversibility warnings or rate limit disclosures, but covers the critical batch-specific behaviors well.

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 tightly constructed sentences. First establishes the operation and limits; second explains error handling. No redundancy or filler content. Every word serves the agent's understanding of the tool's core contract.

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 single-parameter batch operation, the description covers the essential behavioral quirks (partial failure, cascading analytics deletion). Without an output schema, it could improve by describing the return structure (e.g., arrays of successful/failed deletions), though 'reported as not_found' hints at the response format.

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 has 100% coverage with 'short_ids' fully documented (array of strings, 1-50 items). Description adds context about what constitutes invalid items ('non-existent short_id') but doesn't add format specifications or examples beyond the schema. Baseline 3 appropriate given schema completeness.

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 the specific action (delete), resource (QR codes and scan analytics), and scope (multiple, up to 50 in single request). The phrase 'multiple QR codes... in a single request' effectively distinguishes this from the singular 'delete_qr_code' sibling tool.

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

Usage Guidelines4/5

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

Provides crucial behavioral guidance on partial failure handling ('reported as not_found without failing the whole batch'), which informs the agent when to use bulk vs singular delete. Lacks explicit 'when to use' statement contrasting with the singular alternative, but the batch error semantics provide clear implicit guidance.

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