Skip to main content
Glama

move_note

Relocate or rename notes within your Obsidian vault by specifying source and destination paths to reorganize your knowledge base.

Instructions

Move or rename a note to a new location in the Obsidian vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourcePathYesCurrent path to the note within the vault
destinationPathYesNew path where the note should be moved

Implementation Reference

  • The MCP tool handler for 'move_note'. Validates input arguments and delegates to the moveNote method, then returns success message.
    private async handleMoveNote(args: any) {
      if (!args?.sourcePath || !args?.destinationPath) {
        throw new Error('Source path and destination path are required');
      }
      
      await this.moveNote(args.sourcePath, args.destinationPath);
      
      return {
        content: [
          {
            type: 'text',
            text: `Note moved successfully from ${args.sourcePath} to ${args.destinationPath}`,
          },
        ],
      };
    }
  • Core implementation of moving/renaming a note. Attempts Obsidian API operations (read+create+delete) first, falls back to filesystem renameSync with directory creation and cleanup.
    private async moveNote(sourcePath: string, destinationPath: string): Promise<void> {
      try {
        // First try using the Obsidian API - using standard file operations
        // Most Obsidian Local REST API implementations don't support direct move operations
        // So we'll read the source file and create it at the destination, then delete the source
        
        // Read source file content via API
        const sourceResponse = await this.api.get(`/vault/${encodeURIComponent(sourcePath)}`);
        const content = sourceResponse.data.content || '';
        
        // Create destination file via API
        await this.api.post(`/vault/${encodeURIComponent(destinationPath)}`, { content });
        
        // Delete source file via API
        await this.api.delete(`/vault/${encodeURIComponent(sourcePath)}`);
        
      } catch (error) {
        // Fallback to file system operations
        const sourceFullPath = path.join(VAULT_PATH, sourcePath);
        const destFullPath = path.join(VAULT_PATH, destinationPath);
        
        // Validate source file exists
        if (!fs.existsSync(sourceFullPath)) {
          throw new Error(`Source note not found: ${sourcePath}`);
        }
        
        // Check if destination already exists
        if (fs.existsSync(destFullPath)) {
          throw new Error(`Destination already exists: ${destinationPath}`);
        }
        
        // Create destination directory if it doesn't exist
        const destDir = path.dirname(destFullPath);
        if (!fs.existsSync(destDir)) {
          fs.mkdirSync(destDir, { recursive: true });
        }
        
        // Use filesystem rename (works for all file types including PDF)
        try {
          fs.renameSync(sourceFullPath, destFullPath);
        } catch (renameError) {
          throw new Error(`Failed to move file: ${renameError}`);
        }
        
        // Clean up empty source directory if needed
        const sourceDir = path.dirname(sourceFullPath);
        if (sourceDir !== VAULT_PATH) {
          try {
            const items = fs.readdirSync(sourceDir);
            if (items.length === 0) {
              fs.rmdirSync(sourceDir);
            }
          } catch (error) {
            // Ignore errors when cleaning up empty directories
          }
        }
      }
    }
  • Input schema definition for the move_note tool, specifying sourcePath and destinationPath as required string parameters.
      name: 'move_note',
      description: 'Move or rename a note to a new location in the Obsidian vault',
      inputSchema: {
        type: 'object',
        properties: {
          sourcePath: {
            type: 'string',
            description: 'Current path to the note within the vault',
          },
          destinationPath: {
            type: 'string',
            description: 'New path where the note should be moved',
          },
        },
        required: ['sourcePath', 'destinationPath'],
      },
    },
  • src/index.ts:1399-1400 (registration)
    Registration of the move_note tool handler in the CallToolRequestSchema switch statement.
      return await this.handleMoveNote(request.params.arguments);
    case 'manage_folder':
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the tool performs a move/rename operation, implying mutation, but doesn't disclose critical traits like permission requirements, whether it overwrites existing files, error handling for invalid paths, or if it updates internal links. For a mutation tool with zero annotation coverage, this is a significant gap.

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 front-loads the core purpose ('Move or rename a note') and specifies the context ('in the Obsidian vault'). There is zero wasted text, making it highly concise and well-structured for quick understanding.

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 tool's complexity (a mutation operation with 2 required parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like safety, error conditions, or return values, leaving gaps that could hinder an AI agent's ability to invoke it correctly. More context is needed for adequate completeness.

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%, with both parameters clearly documented in the schema. The description adds no additional meaning beyond the schema's details about source and destination paths. According to rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.

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 ('Move or rename') and resource ('a note'), specifying the target location ('new location in the Obsidian vault'). It distinguishes from siblings like 'create_note', 'delete_note', and 'update_note' by focusing on relocation/renaming rather than creation, deletion, or content modification. However, it doesn't explicitly differentiate from 'manage_folder' which might also handle file movements.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., note must exist), exclusions (e.g., cannot move to non-existent folders), or comparisons with siblings like 'update_note' for renaming or 'manage_folder' for broader file operations. Usage is implied but not explicitly defined.

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