Skip to main content
Glama

update_qurl

Update a qURL by extending its expiration, setting an absolute expiry, or modifying its tags and description. Accepts resource ID or qURL display ID. Provide at least one update field.

Instructions

Update a qURL - extend expiration, set an absolute expiry, update tags, or change the description. Accepts either a resource ID (r_ prefix) or qURL display ID (q_ prefix). Do not provide both extend_by and expires_at. At least one update field is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resource_idYesThe resource ID (r_ prefix) or qURL display ID (q_ prefix) to update. If a q_ ID is passed, the API resolves it to the parent resource automatically.
extend_byNoDuration to extend by (e.g., "24h", "7d"). Mutually exclusive with expires_at.
expires_atNoAbsolute expiration timestamp (RFC 3339). Mutually exclusive with extend_by.
tagsNoReplace all tags on this resource (max 10 tags, each 1-50 chars)
descriptionNoReplace the resource description (max 500 chars)

Implementation Reference

  • The updateQurlTool factory function that returns the tool definition with a handler that parses input via refined schema, calls client.updateQURL(), and returns the result as JSON text content.
    export function updateQurlTool(client: IQURLClient) {
      return {
        name: "update_qurl",
        description:
          "Update a qURL - extend expiration, set an absolute expiry, update tags, or change the description. " +
          "Accepts either a resource ID (r_ prefix) or qURL display ID (q_ prefix). " +
          "Do not provide both extend_by and expires_at. At least one update field is required.",
        // Base shape for MCP tool registration; refinements run in the handler
        inputSchema: updateQurlBaseSchema,
        handler: async (raw: z.infer<typeof updateQurlBaseSchema>) => {
          const parsed = updateQurlSchema.safeParse(raw);
          if (!parsed.success) return zodErrorToToolResult(parsed.error);
          const { resource_id, ...body } = parsed.data;
          const result = await client.updateQURL(resource_id, body);
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(result.data),
              },
            ],
          };
        },
      };
    }
  • Base Zod schema for update_qurl input — defines resource_id, extend_by, expires_at, tags, and description fields.
    export const updateQurlBaseSchema = z.object({
      resource_id: resourceIdSchema("update"),
      extend_by: z.string().min(1).optional().describe('Duration to extend by (e.g., "24h", "7d"). Mutually exclusive with expires_at.'),
      expires_at: z.string().datetime().optional().describe("Absolute expiration timestamp (RFC 3339). Mutually exclusive with extend_by."),
      tags: z
        .array(tagSchema)
        .max(10)
        .optional()
        .describe("Replace all tags on this resource (max 10 tags, each 1-50 chars)"),
      description: z
        .string()
        .max(500)
        .optional()
        .describe("Replace the resource description (max 500 chars)"),
    });
  • Refined schema that adds cross-field validation: extend_by/expires_at mutual exclusivity and requirement that at least one update field is present.
    export const updateQurlSchema = updateQurlBaseSchema
      .refine((data) => !(data.extend_by && data.expires_at), {
        message: "Provide either extend_by or expires_at, not both",
      })
      .refine(
        // Use `!== undefined` rather than truthy checks so the API's "clear"
        // semantics work: the spec documents `description: ""` and `tags: []`
        // as valid payloads that clear the field. A plain `||` would reject
        // both because empty string is falsy in JS.
        (data) =>
          data.extend_by !== undefined ||
          data.expires_at !== undefined ||
          data.tags !== undefined ||
          data.description !== undefined,
        {
          message:
            "At least one update field (extend_by, expires_at, tags, or description) is required",
        },
      );
  • src/server.ts:46-54 (registration)
    updateQurlTool is imported and added to the toolFactories array, then registered via server.tool() in the registration loop (lines 51-54).
      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);
    }
  • resourceIdSchema helper used by updateQurlBaseSchema to validate the resource_id parameter.
    export function resourceIdSchema(verb: string) {
      return z
        .string()
        .min(1)
        .describe(
          `The resource ID (r_ prefix) or qURL display ID (q_ prefix) to ${verb}. ` +
            "If a q_ ID is passed, the API resolves it to the parent resource automatically.",
        );
    }
Behavior3/5

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

No annotations provided, so description must cover behavior. It explains ID resolution and mutual exclusivity, but does not clarify if tags replace or append (though parameter schema says 'replace'). Missing potential side effects like overwriting description.

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, front-loaded with purpose, no redundancy. Every sentence adds essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, so missing return value details. Covers key usage constraints but lacks error handling or examples. Adequate for an update tool but could be more complete.

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%, baseline 3. Description adds value by summarizing ID types and constraints, but most parameter details are already in the schema. No new semantics beyond what schema provides.

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 clearly states the tool updates a qURL with specific actions: extend expiration, set expiry, update tags, or change description. It distinguishes itself from siblings like extend_qurl by covering multiple update types.

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 clear guidance on ID type acceptance (r_ or q_ prefix) and mutual exclusivity of extend_by and expires_at, plus requirement of at least one update field. Does not explicitly compare to sibling tools but implies its broader scope.

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