Context
A user reported that replacing tag text (#hashtags) inside note bodies via the MCP server did not update Bear's sidebar tag index. The sidebar still showed the old tag after the replacement. The user's Claude session had to access the SQLite database directly to resync the tag records.
What we know
- The report comes from a single user who was trying to merge and reorganize their tagging system
- Our
bear-replace-text tool uses Bear's add-text x-callback-url action with mode=replace, which updates the note body text (ZSFNOTE.ZTEXT)
- Bear maintains tags in two places: inline
#tag text in the note body, and a separate index table (ZSFNOTETAG + Z_5TAGS junction table)
- Bear's own editor keeps these in sync — typing a tag in the editor updates the index table
- We have a dedicated
bear-rename-tag tool that uses Bear's rename-tag x-callback-url action, which is designed for global tag renaming and presumably updates both text and index
What we don't know — needs verification
Reproduction steps (proposed)
- Create a note with tag
#test-old in the body
- Use
bear-replace-text to replace the section containing #test-old with text containing #test-new
- Check Bear's sidebar: does
#test-new appear? Does #test-old disappear?
- Query
ZSFNOTETAG and Z_5TAGS tables directly to verify index state
Impact
If confirmed, this is a Bear app limitation — not a bug in our code. Mitigation options would be documentation/instructions to guide LLMs, but we should verify before adding any guidance.
Context
A user reported that replacing tag text (
#hashtags) inside note bodies via the MCP server did not update Bear's sidebar tag index. The sidebar still showed the old tag after the replacement. The user's Claude session had to access the SQLite database directly to resync the tag records.What we know
bear-replace-texttool uses Bear'sadd-textx-callback-url action withmode=replace, which updates the note body text (ZSFNOTE.ZTEXT)#tagtext in the note body, and a separate index table (ZSFNOTETAG+Z_5TAGSjunction table)bear-rename-tagtool that uses Bear'srename-tagx-callback-url action, which is designed for global tag renaming and presumably updates both text and indexWhat we don't know — needs verification
add-text mode=replaceactually fail to re-index tags from the changed content? This is the core questionadd-text mode=appendormode=prependwhen adding new tag text?Reproduction steps (proposed)
#test-oldin the bodybear-replace-textto replace the section containing#test-oldwith text containing#test-new#test-newappear? Does#test-olddisappear?ZSFNOTETAGandZ_5TAGStables directly to verify index stateImpact
If confirmed, this is a Bear app limitation — not a bug in our code. Mitigation options would be documentation/instructions to guide LLMs, but we should verify before adding any guidance.