Skip to main content
Glama
bazylhorsey
by bazylhorsey

update_note

Modify existing notes in Obsidian vaults by updating content and metadata to maintain current information and organized knowledge management.

Instructions

Update an existing note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesNew content
frontmatterNoUpdated frontmatter
pathYesPath to the note
vaultYesVault name

Implementation Reference

  • src/index.ts:107-120 (registration)
    Registration of the 'update_note' tool including name, description, and input schema definition.
    {
      name: 'update_note',
      description: 'Update an existing note',
      inputSchema: {
        type: 'object',
        properties: {
          vault: { type: 'string', description: 'Vault name' },
          path: { type: 'string', description: 'Path to the note' },
          content: { type: 'string', description: 'New content' },
          frontmatter: { type: 'object', description: 'Updated frontmatter' },
        },
        required: ['vault', 'path', 'content'],
      },
    },
  • Primary handler for the 'update_note' tool call, which retrieves the vault connector by name and delegates the update operation to it.
    case 'update_note': {
      const connector = this.connectors.get(args?.vault as string);
      if (!connector) {
        throw new Error(`Vault "${args?.vault}" not found`);
      }
      const result = await connector.updateNote(args?.path as string, args?.content as string, args?.frontmatter as Record<string, any> | undefined);
      return {
        content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
      };
    }
  • Implementation of updateNote for local file system vaults: serializes note content with frontmatter and writes to filesystem.
    async updateNote(notePath: string, content: string, frontmatter?: Record<string, any>): Promise<VaultOperationResult<Note>> {
      try {
        const fullPath = path.join(this.config.path!, notePath);
    
        const note: Note = {
          path: notePath,
          title: frontmatter?.title || notePath.split('/').pop()?.replace('.md', '') || 'Untitled',
          content,
          frontmatter
        };
    
        const serialized = serializeNote(note);
        await fs.writeFile(fullPath, serialized, 'utf-8');
    
        // Parse the note to get full structure
        const result = await this.getNote(notePath);
    
        return result;
      } catch (error) {
        return {
          success: false,
          error: `Failed to update note: ${error instanceof Error ? error.message : String(error)}`
        };
      }
    }
  • Implementation of updateNote for remote vaults: sends PUT request to remote API with serialized note content.
    async updateNote(path: string, content: string, frontmatter?: Record<string, any>): Promise<VaultOperationResult<Note>> {
      try {
        const note: Note = {
          path,
          title: frontmatter?.title || path.split('/').pop()?.replace('.md', '') || 'Untitled',
          content,
          frontmatter
        };
    
        const serialized = serializeNote(note);
    
        await this.client.put(`/vault/${encodeURIComponent(path)}`, {
          content: serialized
        });
    
        // Clear cache and refetch
        this.notesCache.delete(path);
        const result = await this.getNote(path);
    
        return result;
      } catch (error) {
        return {
          success: false,
          error: `Failed to update note: ${error instanceof Error ? error.message : String(error)}`
        };
      }
    }
  • Abstract method definition in base connector interface that concrete implementations must provide.
     * Update an existing note
     */
    abstract updateNote(path: string, content: string, frontmatter?: Record<string, any>): Promise<VaultOperationResult<Note>>;
Behavior2/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. 'Update' implies a mutation, but the description doesn't disclose behavioral traits such as permissions required, whether changes are reversible, error handling (e.g., if the note doesn't exist), or rate limits. It lacks context on what happens to existing content or frontmatter not mentioned in the update.

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 with zero waste. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary details.

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?

Given the complexity (a mutation tool with 4 parameters, nested objects, and no output schema), the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral aspects like idempotency. With no annotations and no output schema, more context is needed for effective use.

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 (content, frontmatter, path, vault) with descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining relationships between parameters or usage examples. Baseline is 3 due to high schema coverage.

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

Purpose3/5

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

The description 'Update an existing note' clearly states the verb (update) and resource (note), but it's vague about what aspects are updated. It doesn't distinguish from sibling tools like 'create_note' or 'delete_note' beyond the basic verb difference, and doesn't specify if it updates content, metadata, or both.

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. It doesn't mention prerequisites (e.g., the note must exist), when not to use it (e.g., for creating new notes), or refer to sibling tools like 'create_note' or 'delete_note' for different operations.

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/bazylhorsey/obsidian-mcp-server'

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