Skip to main content
Glama
j-shelfwood

Obsidian Local REST API MCP Server

by j-shelfwood

create_or_update_note

Create or update a note in Obsidian via REST API. Specify path, content, and optional frontmatter to insert or modify notes in your vault.

Instructions

Create or update a note with content and frontmatter. Performs upsert operation - creates if doesn't exist, updates if it does.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesNote content
frontmatterNoFrontmatter metadata
pathYesPath for the note (without .md extension)

Implementation Reference

  • Core handler function in ObsidianApiClient that executes the create_or_update_note tool logic by sending a POST request to the Obsidian REST API /notes/upsert endpoint.
    async createOrUpdateNote(path: string, content: string, frontmatter: Record<string, any> = {}) { return this.request("/notes/upsert", { method: "POST", body: JSON.stringify({ path, content, front_matter: frontmatter }), }); }
  • src/index.ts:327-339 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: "create_or_update_note", description: "Create or update a note with content and frontmatter. Performs upsert operation - creates if doesn't exist, updates if it does.", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path for the note (without .md extension)" }, content: { type: "string", description: "Note content" }, frontmatter: { type: "object", description: "Frontmatter metadata", default: {} }, }, required: ["path", "content"], }, },
  • Dispatch handler in the MCP CallToolRequestSchema that routes calls to create_or_update_note to the client method.
    case "create_or_update_note": result = await this.client.createOrUpdateNote( args?.path as string, args?.content as string, args?.frontmatter as Record<string, any> ); break;

Other Tools

Related Tools

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/j-shelfwood/obsidian-local-rest-api-mcp'

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