Skip to main content
Glama
benswel

QR for Agent

bulk_create_from_csv

Generate up to 500 QR codes from CSV data. Input CSV string with target_url and optional columns for label, colors, styles. Returns all codes. Ideal for bulk QR creation from spreadsheets.

Instructions

Create up to 500 QR codes from CSV data. Pro plan required. Send the CSV content as a string. Required column: target_url. Optional columns: label, format, type, foreground_color, background_color, dot_style, corner_style, frame_style, frame_text, expires_at. Returns all created QR codes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
csv_contentYesCSV content as a string with header row. Example: "target_url,label\nhttps://example.com,My QR\nhttps://other.com,Other QR"

Implementation Reference

  • The handler function for the bulk_create_from_csv tool. Sends CSV content to the /api/qr/bulk/csv endpoint via POST.
    bulk_create_from_csv: {
      description:
        "Create up to 500 QR codes from CSV data. Pro plan required. Send the CSV content as a string. " +
        "Required column: target_url. Optional columns: label, format, type, foreground_color, background_color, " +
        "dot_style, corner_style, frame_style, frame_text, expires_at. Returns all created QR codes.",
      inputSchema: z.object({
        csv_content: z
          .string()
          .describe(
            'CSV content as a string with header row. Example: "target_url,label\\nhttps://example.com,My QR\\nhttps://other.com,Other QR"'
          ),
      }),
      handler: async (input: { csv_content: string }) => {
        return apiRequest("/api/qr/bulk/csv", {
          method: "POST",
          body: { csv_content: input.csv_content },
        });
      },
  • Registration loop that iterates over all exported tools (including bulk_create_from_csv) and registers them with the MCP server.
    for (const [name, tool] of Object.entries(tools)) {
      server.tool(
        name,
        tool.description,
        tool.inputSchema.shape,
        async (input: Record<string, unknown>) => {
          try {
            const result = await tool.handler(input as any);
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify(result, null, 2),
                },
              ],
            };
          } catch (error) {
            const message = error instanceof Error ? error.message : String(error);
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify({
                    error: message,
                    hint: "Check the input parameters and try again. Use list_qr_codes to verify available QR codes.",
                  }),
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
  • Helper function apiRequest that makes HTTP API calls. Used by the bulk_create_from_csv handler to POST to /api/qr/bulk/csv.
    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?

No annotations provided; description discloses limit (500), plan requirement, and output (returns all created QR codes). Does not mention idempotency or side effects.

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?

Three sentences with no waste; front-loaded with purpose and key constraints.

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?

Covers input format, required/optional columns, limit, plan, and output. No output schema exists, but description explains return value.

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?

Schema description coverage is 100% but only shows an example. Description adds meaning by listing required and optional columns and their purposes.

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?

Clear verb 'Create', resource 'QR codes', and method 'from CSV data'. Distinguishes from sibling 'bulk_create_qr_codes' by specifying data source.

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?

Explicitly states pro plan requirement, CSV format, required/optional columns, and limit. Lacks contrast with alternative tools but provides sufficient 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