Skip to main content
Glama

list_qurls

Retrieve a list of qURLs with optional filters by status, creation or expiration date, and search query to find specific expiring, scoped URLs.

Instructions

List qURLs with optional filtering by status, date ranges, and search query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of qURLs to return (default: 20)
cursorNoPagination cursor from a previous response
statusNoFilter by status (comma-separated, e.g., 'active,revoked')
created_afterNoFilter: created after this date (RFC 3339)
created_beforeNoFilter: created before this date (RFC 3339)
expires_beforeNoFilter: expires before this date (RFC 3339)
expires_afterNoFilter: expires after this date (RFC 3339)
sortNoSort field and direction as 'field:direction'. Valid fields: created_at, expires_at. Valid directions: asc, desc (default desc). Example: 'created_at:desc'.
qNoSearch query (searches description and target_url)

Implementation Reference

  • The main tool factory function. Creates the MCP tool definition with name 'list_qurls', description, Zod inputSchema, and the async handler that calls client.listQURLs() and returns the JSON result.
    export function listQurlsTool(client: IQURLClient) {
      return {
        name: "list_qurls",
        description:
          "List qURLs with optional filtering by status, date ranges, and search query.",
        inputSchema: listQurlsSchema,
        handler: async (input: z.infer<typeof listQurlsSchema>) => {
          const result = await client.listQURLs(input);
          return {
            content: [
              {
                type: "text" as const,
                // Full result (not .data) — includes meta.next_cursor for pagination
                text: JSON.stringify(result),
              },
            ],
          };
        },
      };
    }
  • Zod schema for the list_qurls tool input. Defines optional parameters: limit (1-100), cursor (pagination), status (comma-separated), created_after/before, expires_before/after (RFC 3339 dates), sort (created_at|expires_at with :asc/:desc), and q (free-text search).
    export const listQurlsSchema = z.object({
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum number of qURLs to return (default: 20)"),
      cursor: z.string().optional().describe("Pagination cursor from a previous response"),
      // Plain string (not z.enum) because the API accepts comma-separated values like "active,revoked"
      status: z
        .string()
        .min(1)
        .optional()
        .describe("Filter by status (comma-separated, e.g., 'active,revoked')"),
      created_after: z.string().datetime().optional().describe("Filter: created after this date (RFC 3339)"),
      created_before: z.string().datetime().optional().describe("Filter: created before this date (RFC 3339)"),
      expires_before: z.string().datetime().optional().describe("Filter: expires before this date (RFC 3339)"),
      expires_after: z.string().datetime().optional().describe("Filter: expires after this date (RFC 3339)"),
      sort: z
        .string()
        .regex(
          /^(created_at|expires_at)(:(asc|desc))?$/,
          "sort must be 'created_at' or 'expires_at', optionally followed by ':asc' or ':desc'",
        )
        .optional()
        .describe(
          "Sort field and direction as 'field:direction'. " +
            "Valid fields: created_at, expires_at. Valid directions: asc, desc (default desc). " +
            "Example: 'created_at:desc'.",
        ),
      q: z
        .string()
        .min(1)
        .optional()
        .describe("Search query (searches description and target_url)"),
    });
  • src/server.ts:39-54 (registration)
    Registration of list_qurlsTool in the MCP server. The tool factory is included in the toolFactories array, instantiated with the client, and registered via server.tool() with its name, description, schema shape, and handler.
    const toolFactories = [
      createQurlTool,
      resolveQurlTool,
      listQurlsTool,
      getQurlTool,
      deleteQurlTool,
      extendQurlTool,
      updateQurlTool,
      mintLinkTool,
      batchCreateTool,
    ] satisfies ToolFactory[];
    
    for (const factory of toolFactories) {
      const tool = factory(client);
      server.tool(tool.name, tool.description, tool.inputSchema.shape, tool.handler);
    }
  • The QURLClient.listQURLs() method that makes the actual HTTP GET request to /v1/qurls with query parameters for pagination, filtering, and search.
    async listQURLs(input?: ListQURLsInput): Promise<ListQURLsOutput> {
      const params = new URLSearchParams();
      if (input?.limit !== undefined) params.set("limit", String(input.limit));
      if (input?.cursor) params.set("cursor", input.cursor);
      if (input?.status) params.set("status", input.status);
      if (input?.created_after) params.set("created_after", input.created_after);
      if (input?.created_before) params.set("created_before", input.created_before);
      if (input?.expires_before) params.set("expires_before", input.expires_before);
      if (input?.expires_after) params.set("expires_after", input.expires_after);
      if (input?.sort) params.set("sort", input.sort);
      if (input?.q) params.set("q", input.q);
      const query = params.toString();
      return this.request("GET", `/v1/qurls${query ? `?${query}` : ""}`);
    }
  • TypeScript interface defining the input shape for listQURLs, matching the Zod schema fields.
    export interface ListQURLsInput {
      limit?: number;
      cursor?: string;
      /** Filter by status. Accepts comma-separated values, e.g. `"active,revoked"`. */
      status?: string;
      /** RFC 3339 timestamp. */
      created_after?: string;
      /** RFC 3339 timestamp. */
      created_before?: string;
      /** RFC 3339 timestamp. */
      expires_before?: string;
      /** RFC 3339 timestamp. */
      expires_after?: string;
      /** Sort field and direction, e.g. `"created_at:desc"`. */
      sort?: string;
      /** Free-text search over description and target_url. */
      q?: string;
    }
Behavior2/5

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

The description does not disclose that the operation is read-only, whether authentication is needed, or that results are paginated. With no annotations, the agent lacks essential behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single focused sentence without extraneous words. It front-loads the action and key features, making it easy to scan.

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?

Given 9 parameters, no output schema, and no annotations, the description is insufficient. It fails to mention pagination, cursor usage, sorting, or the response format, which are critical for a list tool.

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 coverage is 100% with detailed parameter descriptions, so the description adds little beyond summarizing filter types. Baseline of 3 is appropriate as it doesn't introduce new semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (List) and resource (qURLs) with optional filters. It distinguishes from siblings like 'get_qurl' (single retrieval) implicitly, but could explicitly note that it returns multiple items.

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 on when to use this tool vs alternatives like 'get_qurl' for a specific qURL or 'batch_create_qurls' for creation. The description does not provide context for selection.

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/layervai/qurl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server