Skip to main content
Glama

create_note

Create new notes in Obsidian vaults by specifying file paths and content for organized knowledge management.

Instructions

Create a new note in the Obsidian vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath where the note should be created
contentYesContent of the note

Implementation Reference

  • Core handler function that creates a new note by POSTing to the Obsidian Local REST API endpoint or falling back to direct filesystem operations including automatic directory creation.
    private async createNote(notePath: string, content: string): Promise<void> {
      try {
        // First try using the Obsidian API
        await this.api.post(`/vault/${encodeURIComponent(notePath)}`, { content });
      } catch (error) {
        console.warn('API request failed, falling back to file system:', error);
        
        // Fallback to file system if API fails
        const fullPath = path.join(VAULT_PATH, notePath);
        const dir = path.dirname(fullPath);
        
        if (!fs.existsSync(dir)) {
          fs.mkdirSync(dir, { recursive: true });
        }
        
        fs.writeFileSync(fullPath, content, 'utf-8');
      }
    }
  • MCP tool call handler for 'create_note' that performs input validation and delegates to the createNote implementation.
    private async handleCreateNote(args: any) {
      if (!args?.path || !args?.content) {
        throw new Error('Path and content are required');
      }
      
      await this.createNote(args.path, args.content);
      
      return {
        content: [
          {
            type: 'text',
            text: `Note created successfully at ${args.path}`,
          },
        ],
      };
    }
  • src/index.ts:1146-1162 (registration)
    Tool registration in the ListToolsRequestSchema response, including name, description, and input schema.
      name: 'create_note',
      description: 'Create a new note in the Obsidian vault',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Path where the note should be created',
          },
          content: {
            type: 'string',
            description: 'Content of the note',
          },
        },
        required: ['path', 'content'],
      },
    },
  • Input schema definition specifying required 'path' and 'content' string parameters for the tool.
    inputSchema: {
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Path where the note should be created',
        },
        content: {
          type: 'string',
          description: 'Content of the note',
        },
      },
      required: ['path', 'content'],
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a note but doesn't cover critical behaviors like whether it overwrites existing files, requires specific permissions, handles errors, or returns any output. This leaves significant gaps for a mutation tool.

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 a single, efficient sentence that directly states the tool's purpose without any fluff. It is front-loaded and appropriately sized, making it easy to parse quickly.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens on success or failure, whether the note is immediately saved, or how it interacts with other tools like 'auto_backlink_vault'. More context is needed given the complexity of file creation.

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?

The input schema has 100% description coverage, with clear documentation for both parameters ('path' and 'content'). The description adds no additional semantic context beyond what the schema provides, such as path format examples or content constraints, so it meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Create') and resource ('new note in the Obsidian vault'), making the purpose immediately understandable. It distinguishes from siblings like 'update_note' or 'delete_note' by specifying creation, but doesn't explicitly differentiate from all siblings (e.g., 'manage_folder' could also involve creation).

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'update_note' for modifying existing notes or 'manage_folder' for folder-related operations. The description lacks context on prerequisites, such as whether the path must exist or if overwriting is allowed, leaving usage unclear.

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/newtype-01/obsidian-mcp'

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