mergeTags
Combine multiple tags into a single destination tag within the Raindrop.io bookmark manager for streamlined organization and better management of tagged resources.
Instructions
Merge multiple tags into one destination tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | No | Collection ID (optional) | |
| destinationTag | Yes | Destination tag name | |
| sourceTags | Yes | List of source tags to merge |
Implementation Reference
- MCP handler function for the 'tag_manage' tool, which implements the 'merge' operation by calling raindropService.mergeTagsasync function handleTagManage(args: z.infer<typeof TagInputSchema>, { raindropService }: ToolHandlerContext) { switch (args.operation) { case 'rename': if (!args.tagNames || !args.newName) throw new Error('tagNames and newName required for rename'); const [primaryTag] = args.tagNames; if (!primaryTag) throw new Error('tagNames must include at least one value'); return await raindropService.renameTag(args.collectionId, primaryTag, args.newName!); case 'merge': if (!args.tagNames || !args.newName) throw new Error('tagNames and newName required for merge'); return await raindropService.mergeTags(args.collectionId, args.tagNames, args.newName!); case 'delete': if (!args.tagNames) throw new Error('tagNames required for delete'); return await raindropService.deleteTags(args.collectionId, args.tagNames); default: throw new Error(`Unsupported operation: ${String(args.operation)}`); } }
- Input schema for tag management operations, including 'merge' for merging tagsexport const TagInputSchema = z.object({ collectionId: z.number().optional(), tagNames: z.array(z.string()), newName: z.string().optional(), operation: z.enum(["rename", "merge", "delete"]), });
- src/services/raindropmcp.service.ts:424-430 (registration)Tool configuration and registration definition for 'tag_manage', which supports mergeTags functionalityconst tagManageTool = defineTool({ name: 'tag_manage', description: 'Renames, merges, or deletes tags. Use the operation parameter to specify the action.', inputSchema: TagInputSchema, outputSchema: TagOutputSchema, handler: handleTagManage, });
- Core helper function implementing mergeTags by calling Raindrop.io API PUT /tags/{collectionId} with tags to merge into newNameasync mergeTags(collectionId: number | undefined, tags: string[], newName: string): Promise<boolean> { const endpoint = collectionId ? '/tags/{collectionId}' : '/tags/0'; const options = { ...(collectionId && { params: { path: { id: collectionId } } }), body: { tags, to: newName } }; const { data } = await (this.client as any).PUT(endpoint, options); return !!data?.result; }