extend_qurl
Extend the expiration time of an active qURL by providing a resource ID or qURL display ID and a duration (e.g., '24h', '7d').
Instructions
Extend the expiration of an active qURL. Accepts a resource ID (r_) or qURL display ID (q_). Shorthand for update_qurl with only extend_by — use update_qurl for richer updates (tags, description, expiration).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_id | Yes | The resource ID (r_ prefix) or qURL display ID (q_ prefix) to extend. If a q_ ID is passed, the API resolves it to the parent resource automatically. | |
| extend_by | Yes | Duration to extend by (e.g., "24h", "7d") |
Implementation Reference
- src/tools/extend-qurl.ts:10-31 (handler)The extendQurlTool factory returns the tool definition including the 'extend_qurl' handler function. The handler calls client.extendQURL with the resource_id and extend_by input, then returns the result as JSON text content.
export function extendQurlTool(client: IQURLClient) { return { name: "extend_qurl", description: "Extend the expiration of an active qURL. Accepts a resource ID (r_) or qURL display ID (q_). " + "Shorthand for update_qurl with only extend_by — use update_qurl for richer updates (tags, description, expiration).", inputSchema: extendQurlSchema, handler: async (input: z.infer<typeof extendQurlSchema>) => { const result = await client.extendQURL(input.resource_id, { extend_by: input.extend_by, }); return { content: [ { type: "text" as const, text: JSON.stringify(result.data), }, ], }; }, }; } - src/tools/extend-qurl.ts:5-8 (schema)The extendQurlSchema defines the input schema with a resource_id (validated via resourceIdSchema) and extend_by (a non-empty string describing the duration to extend by, e.g. '24h').
export const extendQurlSchema = z.object({ resource_id: resourceIdSchema("extend"), extend_by: z.string().min(1).describe('Duration to extend by (e.g., "24h", "7d")'), }); - src/server.ts:32-73 (registration)The extend_qurl tool is registered in createServer() via the ToolFactory pattern - extendQurlTool is listed in the toolFactories array (line 45) and registered with server.tool() in the loop at lines 51-54.
export function createServer(client: IQURLClient, version: string): McpServer { const server = new McpServer({ name: "qurl", version, }); // Register tools 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); } // Register resources for (const factory of [linksResource, usageResource]) { const resource = factory(client); server.resource(resource.name, resource.uri, resource.handler); } // Register prompts const secure = secureAServicePrompt(); server.prompt(secure.name, secure.description, secure.args, secure.handler); const audit = auditLinksPrompt(); server.prompt(audit.name, audit.description, audit.handler); const rotate = rotateAccessPrompt(); server.prompt(rotate.name, rotate.description, rotate.args, rotate.handler); return server; } - src/client.ts:359-363 (helper)The client.extendQURL method on the QURLClient class delegates to updateQURL (PATCH request), since ExtendQURLInput is a strict subset of UpdateQURLInput (just extend_by).
async extendQURL(id: string, input: ExtendQURLInput): Promise<{ data: QURL }> { // ExtendQURLInput is a strict subset of UpdateQURLInput (just extend_by), // so we delegate to updateQURL rather than duplicating the PATCH call. return this.updateQURL(id, input); } - src/client.ts:107-109 (helper)The ExtendQURLInput interface defines the shape for the extend operation - just a single required 'extend_by' string field.
export interface ExtendQURLInput { extend_by: string; }