renameTag
Update a tag's name in all bookmarks or within a specific collection in Raindrop.io. Provide the current and new tag names for efficient organization.
Instructions
Rename a tag across all bookmarks or in a specific collection
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionId | No | Collection ID (optional) | |
| newName | Yes | New tag name | |
| oldName | Yes | Current tag name |
Implementation Reference
- src/services/raindrop.service.ts:286-294 (handler)Core handler function implementing the renameTag logic via Raindrop.io API PUT request to rename a tag.async renameTag(collectionId: number | undefined, oldName: string, newName: string): Promise<boolean> { const endpoint = collectionId ? '/tags/{collectionId}' : '/tags/0'; const options = { ...(collectionId && { params: { path: { id: collectionId } } }), body: { from: oldName, to: newName } }; const { data } = await (this.client as any).PUT(endpoint, options); return !!data?.result; }
- Handler logic within the 'tag_manage' MCP tool for the 'rename' operation, which delegates to the renameTag service method.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':
- Zod input schema for tag management operations, supporting 'rename' with collectionId, tagNames, newName.export 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)Declarative registration/configuration of the 'tag_manage' MCP tool that encompasses the renameTag functionality via operation='rename'.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, });