obsidian_batch_create_notes
Create multiple Obsidian notes in a single API call, with each note's success or error reported independently. Supports optional vault, frontmatter, and overwrite settings.
Instructions
Create many notes in one call. Each item reports success or error independently unless stopOnError is true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vault | No | Optional configured vault name. Defaults to the server default vault. | |
| notes | Yes | ||
| stopOnError | No |
Implementation Reference
- src/tools.ts:649-671 (registration)Registration and handler for obsidian_batch_create_notes. Defines the schema (vault, notes array with path/content/frontmatter/overwrite, stopOnError) and inline handler that iterates over notes, stringifies frontmatter if provided, writes each note via vaults.writeText, and collects per-note success/error results.
tool( "obsidian_batch_create_notes", "Create many notes in one call. Each item reports success or error independently unless stopOnError is true.", { vault: vaultArg, notes: z.array(z.object({ path: z.string(), content: z.string().default(""), frontmatter: z.record(z.unknown()).optional(), overwrite: z.boolean().optional().default(false) })).min(1).max(100), stopOnError: z.boolean().optional().default(false), }, async (args) => { const results = []; for (const note of args.notes) { try { const text = note.frontmatter ? stringifyFrontmatter(note.frontmatter, note.content) : note.content; results.push({ ok: true, ...(await vaults.writeText(vaults.notePath(note.path), text, args.vault, { overwrite: note.overwrite })) }); } catch (error) { results.push({ ok: false, path: note.path, error: error instanceof Error ? error.message : String(error) }); if (args.stopOnError) break; } } return { results }; }, { destructiveHint: false }, ); - src/tools.ts:653-656 (schema)Zod schema for obsidian_batch_create_notes: accepts an array of 1-100 notes, each with required path, optional content (default ''), optional frontmatter record, optional overwrite (default false), and a top-level stopOnError flag.
vault: vaultArg, notes: z.array(z.object({ path: z.string(), content: z.string().default(""), frontmatter: z.record(z.unknown()).optional(), overwrite: z.boolean().optional().default(false) })).min(1).max(100), stopOnError: z.boolean().optional().default(false), }, - src/index.ts:23-24 (registration)Entry point: registerObsidianTools is called in createObsidianMcpServer, which registers all tools including obsidian_batch_create_notes on the MCP server.
registerObsidianResources(server, vaults, config); registerObsidianTools(server, vaults, config);