Skip to main content
Glama

create_note

Create new notes with Markdown content in Obsidian vaults, supporting nested folder structures and optional overwrite functionality.

Instructions

Create a new note in the Obsidian vault. Supports nested folder creation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath for the new note relative to vault root (e.g., 'folder/note.md')
contentYesContent of the note in Markdown format
overwriteNoIf true, overwrite existing note. Default: false

Implementation Reference

  • The handler function that executes the create_note tool: resolves the full path, checks for existence unless overwrite is true, ensures the directory exists, writes the content to the file, and returns a success message.
    async function handleCreateNote(args: { path: string; content: string; overwrite?: boolean; }): Promise<string> { const fullPath = resolvePath(args.path); if (!args.overwrite && (await fileExists(fullPath))) { throw new Error( `Note already exists at ${args.path}. Use overwrite: true to replace.` ); } await ensureDir(fullPath); await fs.writeFile(fullPath, args.content, "utf-8"); return `Successfully created note at ${args.path}`; }
  • The input schema defining parameters for the create_note tool: path (string, required), content (string, required), overwrite (boolean, optional, default false).
    inputSchema: { type: "object", properties: { path: { type: "string", description: "Path for the new note relative to vault root (e.g., 'folder/note.md')", }, content: { type: "string", description: "Content of the note in Markdown format", }, overwrite: { type: "boolean", description: "If true, overwrite existing note. Default: false", default: false, }, }, required: ["path", "content"], },
  • src/index.ts:25-49 (registration)
    The tool registration entry in the tools array, including name, description, and input schema. This is used for listing available tools.
    { name: "create_note", description: "Create a new note in the Obsidian vault. Supports nested folder creation.", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path for the new note relative to vault root (e.g., 'folder/note.md')", }, content: { type: "string", description: "Content of the note in Markdown format", }, overwrite: { type: "boolean", description: "If true, overwrite existing note. Default: false", default: false, }, }, required: ["path", "content"], }, },
  • src/index.ts:865-869 (registration)
    The dispatch case in the tool call handler switch statement that routes 'create_note' calls to the handleCreateNote function.
    case "create_note": result = await handleCreateNote( args as { path: string; content: string; overwrite?: boolean } ); break;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sureshsankaran/obsidian-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server