bear_remove_tag
Remove a tag from a Bear note. Works on visible tags and ancestor tags, handling hierarchical expansions.
Instructions
Remove a tag from a specific Bear note. Works on any tag visible in 'tags' on the note — including ancestor tags like 'parent' that exist only as hierarchical expansions. Removing a hierarchical leaf like 'parent/child' also drops orphaned ancestors from the tag index.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Note ID (uniqueIdentifier) | |
| tag | Yes | Tag to remove (without #) |
Implementation Reference
- mcp-server/src/tools.ts:568-600 (handler)The ToolHandler definition for bear_remove_tag. Defines the tool's schema (name, description, inputSchema requiring id and tag strings, annotations) and the buildArgs function that constructs the CLI command array ['tag', 'remove', id, tag, '--json'] to delegate to the underlying bcli tool.
bear_remove_tag: { tool: { name: "bear_remove_tag", description: "Remove a tag from a specific Bear note. Works on any tag visible in 'tags' on the note — including ancestor tags like 'parent' that exist only as hierarchical expansions. Removing a hierarchical leaf like 'parent/child' also drops orphaned ancestors from the tag index.", inputSchema: { type: "object" as const, properties: { id: { type: "string", description: "Note ID (uniqueIdentifier)", }, tag: { type: "string", description: "Tag to remove (without #)", }, }, required: ["id", "tag"], }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, }, }, buildArgs: (input) => [ "tag", "remove", String(input.id), String(input.tag), "--json", ], }, - mcp-server/src/index.ts:29-31 (registration)Tool registration via the ListToolsRequestSchema handler. All tools from the tools.ts module (including bear_remove_tag) are registered by mapping over Object.values(tools) to expose their tool definitions to the MCP client.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), })); - mcp-server/src/index.ts:33-35 (registration)Tool call dispatch via the CallToolRequestSchema handler. When a tool named 'bear_remove_tag' is called, it's looked up by name from the tools map (const handler = tools[name]), then handler.buildArgs(params) builds the CLI args array which is executed via execBcliWithReauth.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: input } = request.params; const handler = tools[name];