Skip to main content
Glama
j-shelfwood

Obsidian Local REST API MCP Server

by j-shelfwood

create_or_update_note

Create or update Obsidian notes with content and metadata using an upsert operation that creates new notes or updates existing ones.

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
pathYesPath for the note (without .md extension)
contentYesNote content
frontmatterNoFrontmatter metadata

Implementation Reference

  • The core handler function in the ObsidianApiClient class that executes the tool logic by making a POST request to the Obsidian REST API /notes/upsert endpoint with the provided path, content, and frontmatter.
    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
        }),
      });
    }
  • JSON schema defining the input parameters and validation for the create_or_update_note tool: path and content required, frontmatter optional.
    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"],
    },
  • src/index.ts:327-339 (registration)
    Tool registration in the listTools response, including name, description, and 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 server's CallToolRequestSchema that routes the tool call 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;
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses the upsert behavior and mentions content and frontmatter, but lacks details on permissions, error handling, rate limits, or what happens to existing frontmatter during updates. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and uses only two concise sentences that earn their place: the first states what it does, and the second explains the upsert behavior. There is zero waste or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation with 3 parameters, nested objects, no output schema, and no annotations), the description is adequate but incomplete. It covers the basic operation and upsert logic but lacks details on permissions, error cases, or return values, which are important for a mutation tool without structured output documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (path, content, frontmatter). The description adds marginal value by mentioning 'content and frontmatter' and implying the path identifies the note, but doesn't provide additional syntax, format, or constraints beyond what the schema specifies. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb ('create or update') and resource ('a note with content and frontmatter'), distinguishing it from siblings like 'get_note' (read-only) or 'delete_item' (removal). It explicitly mentions the upsert behavior, which differentiates it from simple create or update operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Performs upsert operation - creates if doesn't exist, updates if it does'), which helps differentiate it from alternatives like 'write_file' (generic) or 'get_note' (read-only). However, it doesn't explicitly state when NOT to use it or compare with all relevant siblings (e.g., 'write_file' for non-note files).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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