bear_create_note
Create a new Bear note with title, body, tags, and YAML front matter. Inline hashtags are extracted as real tags; hierarchical tags index ancestors. Returns the note ID.
Instructions
Create a new Bear note with a title, optional body text, tags, and YAML front matter. Hashtags written inline in the body (e.g. '#my_tag' or '#parent/child') are extracted and registered as real tags on the note, matching Bear's desktop-app behaviour. Tags from the 'tags' array are indexed regardless of whether they appear in the body. Hierarchical tags like '#parent/child' also index every ancestor (so they show up under #parent in Bear's sidebar). Front matter is stored as a collapsed metadata block at the top of the note. Returns the new note's ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Note title | |
| body | No | Note body text (markdown) | |
| tags | No | Tags to assign to the note | |
| frontmatter | No | YAML front matter fields as key-value pairs (e.g. {status: 'draft', project: 'alpha'}) |
Implementation Reference
- mcp-server/src/tools.ts:147-198 (registration)Registration of the bear_create_note tool as part of the tools registry, exported from tools.ts and consumed by index.ts
bear_create_note: { tool: { name: "bear_create_note", description: "Create a new Bear note with a title, optional body text, tags, and YAML front matter. Hashtags written inline in the body (e.g. '#my_tag' or '#parent/child') are extracted and registered as real tags on the note, matching Bear's desktop-app behaviour. Tags from the 'tags' array are indexed regardless of whether they appear in the body. Hierarchical tags like '#parent/child' also index every ancestor (so they show up under #parent in Bear's sidebar). Front matter is stored as a collapsed metadata block at the top of the note. Returns the new note's ID.", inputSchema: { type: "object" as const, properties: { title: { type: "string", description: "Note title", }, body: { type: "string", description: "Note body text (markdown)", }, tags: { type: "array", items: { type: "string" }, description: "Tags to assign to the note", }, frontmatter: { type: "object", description: "YAML front matter fields as key-value pairs (e.g. {status: 'draft', project: 'alpha'})", additionalProperties: { type: "string" }, }, }, required: ["title"], }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, }, }, buildArgs: (input) => { const args = ["create", String(input.title), "--json"]; if (input.body) args.push("--body", String(input.body)); if (Array.isArray(input.tags) && input.tags.length > 0) { args.push("--tags", input.tags.join(",")); } if (input.frontmatter && typeof input.frontmatter === "object") { const fm = input.frontmatter as Record<string, string>; args.push( "--fm", ...Object.entries(fm).map(([k, v]) => `${k}=${v}`), ); } return args; }, }, - mcp-server/src/tools.ts:152-176 (schema)Input schema for bear_create_note: title (required), body (optional), tags (optional string array), frontmatter (optional string-string object)
inputSchema: { type: "object" as const, properties: { title: { type: "string", description: "Note title", }, body: { type: "string", description: "Note body text (markdown)", }, tags: { type: "array", items: { type: "string" }, description: "Tags to assign to the note", }, frontmatter: { type: "object", description: "YAML front matter fields as key-value pairs (e.g. {status: 'draft', project: 'alpha'})", additionalProperties: { type: "string" }, }, }, required: ["title"], }, - mcp-server/src/tools.ts:183-197 (handler)Handler logic: builds CLI arguments for 'bcli create' command with optional --body, --tags, and --fm flags based on input parameters
buildArgs: (input) => { const args = ["create", String(input.title), "--json"]; if (input.body) args.push("--body", String(input.body)); if (Array.isArray(input.tags) && input.tags.length > 0) { args.push("--tags", input.tags.join(",")); } if (input.frontmatter && typeof input.frontmatter === "object") { const fm = input.frontmatter as Record<string, string>; args.push( "--fm", ...Object.entries(fm).map(([k, v]) => `${k}=${v}`), ); } return args; }, - mcp-server/src/index.ts:29-31 (registration)MCP server registration: all tools (including bear_create_note) are listed via ListToolsRequestSchema and invoked via CallToolRequestSchema, which looks up the tool by name from the tools registry
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: Object.values(tools).map((t) => t.tool), }));