duplicateList
Duplicate an existing list in Godspeed by providing the list ID and a new name, enabling quick replication of list structures for efficient task management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| name | No |
Implementation Reference
- src/index.ts:228-247 (registration)MCP server.tool registration for the 'duplicateList' tool, including inline Zod input schema and thin handler wrapper that calls the Godspeed API and formats the response as text content.
server.tool( "duplicateList", { list_id: z.string(), name: z.string().optional() }, async (params) => { try { const { list_id, name } = params; const result = await godspeedApi.duplicateList(list_id, name ? { name } : undefined); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }] }; } } ); - src/godspeed.ts:292-316 (helper)Core helper function in GodspeedAPI class that implements the list duplication by sending a POST request to the Godspeed API endpoint /lists/{listId}/duplicate.
async duplicateList(listId: string, params?: DuplicateListParams): Promise<ApiResponse<TaskList>> { try { if (!listId) { throw new Error('List ID is required'); } const headers = this.getAuthHeaders(); const response = await fetch(`${API_BASE_URL}/lists/${listId}/duplicate`, { method: 'POST', headers, body: JSON.stringify(params || {}), }); const data = await response.json(); if (!response.ok) { throw new Error(data.error || 'Failed to duplicate list'); } return data; } catch (error) { throw new Error(`Duplicate list error: ${error instanceof Error ? error.message : String(error)}`); } } - src/types.ts:99-101 (schema)TypeScript interface defining optional parameters (name) for duplicating a list, used by the GodspeedAPI.duplicateList method.
export interface DuplicateListParams { name?: string; }