Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

move_file

Move or rename files and directories within Obsidian iCloud vaults. Specify source and destination paths to transfer files across directories or rename them in-place.

Instructions

Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationYes
sourceYes

Implementation Reference

  • The core handler function for the 'move_file' tool. It validates input using MoveFileArgsSchema and uses Node.js fs.rename to move the file from source to destination path.
    export async function moveFile(args?: Record<string, unknown>) { const parsed = MoveFileArgsSchema.safeParse(args) if (!parsed.success) { throw new Error(`Invalid arguments for move_file: ${parsed.error}`) } await fs.rename(parsed.data.source, parsed.data.destination) return { content: [ { type: 'text', text: `Successfully moved ${parsed.data.source} to ${parsed.data.destination}` } ] } }
  • Zod schema defining the input arguments for the move_file tool: source (current path) and destination (new path) as strings.
    export const MoveFileArgsSchema = z.object({ source: z.string(), destination: z.string() })
  • src/index.ts:153-156 (registration)
    Registers the 'move_file' tool in the MCP server's ListToolsRequestSchema response, providing name, description prompt, and JSON schema from MoveFileArgsSchema.
    name: 'move_file', description: moveFileDirectoryPrompt(), inputSchema: zodToJsonSchema(MoveFileArgsSchema) as ToolInput },
  • Dispatch handler in the CallToolRequestSchema switch statement that invokes the moveFile function with parsed arguments.
    case 'move_file': { return moveFile(args) }

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

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