Skip to main content
Glama

finder_get_current_folder

Retrieve the path of the active Finder window on macOS to identify the current working directory for file operations.

Instructions

Get path of currently viewed folder in frontmost Finder window

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes osascript command to retrieve the POSIX path of the target folder in the frontmost Finder window.
    case 'finder_get_current_folder': try { const command = `osascript -e 'tell application "Finder" to get POSIX path of (target of front window as alias)'`; const { stdout, stderr } = await execAsync(command); if (stderr.trim()) { return { content: [ { type: 'text', text: `Error getting current folder: ${stderr.trim()}`, }, ], }; } const folderPath = stdout.trim(); return { content: [ { type: 'text', text: `Current folder: ${folderPath}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error executing current folder command: ${error.message}`, }, ], }; }
  • src/index.ts:61-67 (registration)
    Tool registration in the ListTools response, including name, description, and empty input schema.
    name: 'finder_get_current_folder', description: 'Get path of currently viewed folder in frontmost Finder window', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for the tool (no parameters required).
    inputSchema: { type: 'object', properties: {}, },

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/samicokar/mcp-mac'

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