Skip to main content
Glama

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
NameRequiredDescriptionDefault
collectionIdNoCollection ID (optional)
destinationTagYesDestination tag name
sourceTagsYesList of source tags to merge

Implementation Reference

  • MCP handler function for the 'tag_manage' tool, which implements the 'merge' operation by calling raindropService.mergeTags
    async 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 tags
    export const TagInputSchema = z.object({ collectionId: z.number().optional(), tagNames: z.array(z.string()), newName: z.string().optional(), operation: z.enum(["rename", "merge", "delete"]), });
  • Tool configuration and registration definition for 'tag_manage', which supports mergeTags functionality
    const 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 newName
    async 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; }

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/adeze/raindrop-mcp'

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