rename_tag
Update tag names across multiple notes in Bear Notes by specifying old and new tag values to maintain organization consistency.
Instructions
Rename a tag across all notes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| old_tag | Yes | Current tag name (without # prefix) | |
| new_tag | Yes | New tag name (without # prefix) |
Implementation Reference
- src/mcp_bear/bear_url.py:237-257 (handler)The actual implementation of the `rename_tag` function which constructs and executes the Bear x-callback-url.
def rename_tag(old_tag: str, new_tag: str) -> dict[str, str]: """ Rename a tag across all notes. Args: old_tag: Current tag name (without # prefix) new_tag: New tag name (without # prefix) Returns: Dictionary with operation result """ params = { "name": old_tag, "new_name": new_tag } query_string = urllib.parse.urlencode(params) url = f"bear://x-callback-url/rename-tag?{query_string}" return _open_bear_url(url) - src/mcp_bear/server.py:280-296 (registration)Registration of the `rename_tag` tool in the MCP server, defining its schema and input requirements.
name="rename_tag", description="Rename a tag across all notes", inputSchema={ "type": "object", "properties": { "old_tag": { "type": "string", "description": "Current tag name (without # prefix)", }, "new_tag": { "type": "string", "description": "New tag name (without # prefix)", }, }, "required": ["old_tag", "new_tag"], }, ), - src/mcp_bear/server.py:418-423 (handler)Tool call handler in `server.py` that invokes the `rename_tag` implementation from `bear_url.py`.
elif name == "rename_tag": if not isinstance(arguments, dict) or "old_tag" not in arguments or "new_tag" not in arguments: raise ValueError("Missing required arguments: old_tag and new_tag") result = rename_tag(old_tag=arguments["old_tag"], new_tag=arguments["new_tag"]) return [TextContent(type="text", text=str(result))]