bear_rename_tag
Rename a tag across all Bear notes, updating every note that contains the old tag.
Instructions
Rename a tag across all Bear notes. Every note containing the old tag will be updated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| old_name | Yes | Current tag name (without #) | |
| new_name | Yes | New tag name (without #) |
Implementation Reference
- mcp-server/src/tools.ts:602-633 (schema)Definition of the 'bear_rename_tag' tool including its input schema (old_name, new_name), description, and annotations.
bear_rename_tag: { tool: { name: "bear_rename_tag", description: "Rename a tag across all Bear notes. Every note containing the old tag will be updated.", inputSchema: { type: "object" as const, properties: { old_name: { type: "string", description: "Current tag name (without #)", }, new_name: { type: "string", description: "New tag name (without #)", }, }, required: ["old_name", "new_name"], }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => [ "tag", "rename", String(input.old_name), String(input.new_name), "--json", ], - mcp-server/src/tools.ts:627-633 (handler)buildArgs function that constructs the CLI arguments for renaming a tag using 'bcli tag rename <old_name> <new_name> --json'.
buildArgs: (input) => [ "tag", "rename", String(input.old_name), String(input.new_name), "--json", ], - mcp-server/src/index.ts:29-31 (registration)Tool registration via ListToolsRequestSchema - all tools from tools.ts are listed to the MCP client.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), })); - mcp-server/src/index.ts:33-42 (registration)CallToolRequestSchema handler that dispatches incoming tool calls by name, looking up the handler (including bear_rename_tag) from the tools record.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: input } = request.params; const handler = tools[name]; if (!handler) { return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true, }; }