Skip to main content
Glama
sureshsankaran

Obsidian Tools MCP Server

create_note

Create new notes in Obsidian vaults with Markdown content, supporting nested folders 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 and overwrite flag, ensures directory exists, writes the file content, and returns 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}`;
    }
  • Input schema defining parameters for create_note: 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)
    Tool registration in the tools array, including name, description, and input schema, used for ListTools response.
    {
      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)
    Dispatch case in the CallToolRequestSchema handler 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