bear_context_add
Tag a Bear note with #context to add it to your context library. Optionally specify a subtag like #context/jira for grouping.
Instructions
Add a Bear note to the context library by tagging it with #context. Optionally specify a subtag for grouping (e.g., subtag 'jira' → #context/jira). Triggers a sync after tagging.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Note ID (uniqueIdentifier) | |
| subtag | No | Optional sub-tag for grouping (e.g., 'architecture', 'jira') |
Implementation Reference
- mcp-server/src/tools.ts:898-921 (schema)Schema definition: input validation and tool metadata for bear_context_add. Requires 'id' (string), optional 'subtag' (string). It's non-destructive and idempotent.
tool: { name: "bear_context_add", description: "Add a Bear note to the context library by tagging it with #context. Optionally specify a subtag for grouping (e.g., subtag 'jira' → #context/jira). Triggers a sync after tagging.", inputSchema: { type: "object" as const, properties: { id: { type: "string", description: "Note ID (uniqueIdentifier)", }, subtag: { type: "string", description: "Optional sub-tag for grouping (e.g., 'architecture', 'jira')", }, }, required: ["id"], }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, - mcp-server/src/tools.ts:923-927 (handler)Handler/buildArgs: builds CLI args to invoke external bcli tool with 'context add <id> --json' and optionally '--subtag <subtag>'. This is the core execution logic - the tool delegates to the bcli binary.
buildArgs: (input) => { const args = ["context", "add", String(input.id), "--json"]; if (input.subtag) args.push("--subtag", String(input.subtag)); return args; }, - mcp-server/src/tools.ts:897-928 (registration)Registration: the tool is defined as an entry in the exported 'tools' Record<string, ToolHandler> map at line 9. It is discoverable by the MCP server via Object.values(tools) in index.ts.
bear_context_add: { tool: { name: "bear_context_add", description: "Add a Bear note to the context library by tagging it with #context. Optionally specify a subtag for grouping (e.g., subtag 'jira' → #context/jira). Triggers a sync after tagging.", inputSchema: { type: "object" as const, properties: { id: { type: "string", description: "Note ID (uniqueIdentifier)", }, subtag: { type: "string", description: "Optional sub-tag for grouping (e.g., 'architecture', 'jira')", }, }, required: ["id"], }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, }, }, buildArgs: (input) => { const args = ["context", "add", String(input.id), "--json"]; if (input.subtag) args.push("--subtag", String(input.subtag)); return args; }, },