bear_context_set_prefix
Update the tag prefix for your context library, re-tagging all Bear notes with the new prefix while preserving sub-tags. Aligns qualifier tags with naming schemes like Johnny Decimal.
Instructions
Change the context library's tag prefix and re-tag every Bear note that currently uses the old prefix. Sub-tags are preserved — #context/research becomes #<new>/research. Updates both the markdown body and the CloudKit tag index, and persists the new prefix to the context config. Useful when aligning the qualifier tag with a broader naming scheme like Johnny Decimal (e.g. '10-projects'). Run bear_context_sync afterwards to refresh the library.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_prefix | Yes | New tag prefix without the leading #. Example: '10-projects'. |
Implementation Reference
- mcp-server/src/tools.ts:1142-1151 (schema)Input schema for bear_context_set_prefix - requires a new_prefix string for the tag prefix
inputSchema: { type: "object" as const, properties: { new_prefix: { type: "string", description: "New tag prefix without the leading #. Example: '10-projects'.", }, }, required: ["new_prefix"], - mcp-server/src/tools.ts:1159-1164 (handler)Builds CLI args: calls 'bcli context set-prefix <new_prefix> --json' to change the context library's tag prefix and re-tag notes
buildArgs: (input) => [ "context", "set-prefix", String(input.new_prefix), "--json", ], - mcp-server/src/tools.ts:1137-1158 (registration)Registration of bear_context_set_prefix tool in the tools registry with its name, description, input schema, and buildArgs
bear_context_set_prefix: { tool: { name: "bear_context_set_prefix", description: "Change the context library's tag prefix and re-tag every Bear note that currently uses the old prefix. Sub-tags are preserved — `#context/research` becomes `#<new>/research`. Updates both the markdown body and the CloudKit tag index, and persists the new prefix to the context config. Useful when aligning the qualifier tag with a broader naming scheme like Johnny Decimal (e.g. '10-projects'). Run `bear_context_sync` afterwards to refresh the library.", inputSchema: { type: "object" as const, properties: { new_prefix: { type: "string", description: "New tag prefix without the leading #. Example: '10-projects'.", }, }, required: ["new_prefix"], }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, },