Skip to main content
Glama

finder_quick_look_file

Preview files on macOS using Quick Look to view content without opening applications. Provide the file path to display a preview.

Instructions

[Finder and file operations] Preview a file using Quick Look

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path to preview

Implementation Reference

  • Handler that generates AppleScript to open Quick Look preview for the given file path by selecting it in Finder and pressing spacebar.
    script: (args) => `
      try
        set filePath to POSIX file "${args.path}"
        tell application "Finder"
          activate
          select filePath
          tell application "System Events"
            -- Press Space to trigger Quick Look
            delay 0.5 -- Small delay to ensure Finder is ready
            key code 49 -- Space key
          end tell
        end tell
        return "Quick Look preview opened for ${args.path}"
      on error errMsg
        return "Failed to open Quick Look: " & errMsg
      end try
    `,
  • JSON Schema defining the input: object with required 'path' string.
    schema: {
      type: "object",
      properties: {
        path: {
          type: "string",
          description: "File path to preview",
        },
      },
      required: ["path"],
    },
  • MCP 'listTools' request handler constructs tool name 'finder_quick_look_file' from category.finder + script.quick_look_file
      tools: this.categories.flatMap((category) =>
        category.scripts.map((script) => ({
          name: `${category.name}_${script.name}`, // Changed from dot to underscore
          description: `[${category.description}] ${script.description}`,
          inputSchema: script.schema || {
            type: "object",
            properties: {},
          },
        })),
      ),
    }));
  • MCP 'callTool' request handler parses 'finder_quick_look_file' into category='finder' and script='quick_look_file'
    const toolName = request.params.name;
    this.log("info", "Tool execution requested", { 
      tool: toolName,
      hasArguments: !!request.params.arguments
    });
    
    try {
      // Split on underscore instead of dot
      const [categoryName, ...scriptNameParts] =
        toolName.split("_");
      const scriptName = scriptNameParts.join("_"); // Rejoin in case script name has underscores
  • src/index.ts:4-27 (registration)
    Imports and registers the 'finder' category containing the quick_look_file script into the MCP server.
    import { finderCategory } from "./categories/finder.js";
    import { clipboardCategory } from "./categories/clipboard.js";
    import { notificationsCategory } from "./categories/notifications.js";
    import { itermCategory } from "./categories/iterm.js";
    import { mailCategory } from "./categories/mail.js";
    import { pagesCategory } from "./categories/pages.js";
    import { shortcutsCategory } from "./categories/shortcuts.js";
    import { messagesCategory } from "./categories/messages.js";
    import { notesCategory } from "./categories/notes.js";
    
    const server = new AppleScriptFramework({
      name: "applescript-server",
      version: "1.0.4",
      debug: false,
    });
    
    // Log startup information using stderr (server isn't connected yet)
    console.error(`[INFO] Starting AppleScript MCP server - PID: ${process.pid}`);
    
    // Add all categories
    console.error("[INFO] Registering categories...");
    server.addCategory(systemCategory);
    server.addCategory(calendarCategory);
    server.addCategory(finderCategory);
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. It states the tool previews a file, implying a read-only operation, but doesn't disclose behavioral traits like whether it opens a temporary window, requires specific permissions, has limitations (e.g., file size), or what happens on errors. This leaves gaps for safe and effective use.

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 extremely concise at one sentence, front-loading the key action ('Preview a file') and method ('using Quick Look'). There is no wasted text, and every word contributes to understanding the tool's purpose efficiently.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on usage, behavior, and output. Without annotations or output schema, more context on what the preview entails would improve completeness for safe agent invocation.

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 the 'path' parameter documented as 'File path to preview'. The description adds no additional meaning beyond this, such as path format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema adequately covers parameter semantics.

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 ('Preview a file') and the method ('using Quick Look'), with the resource being a file. It specifies the tool's purpose as a preview operation rather than opening or editing. However, it doesn't explicitly differentiate from potential siblings like 'finder_get_selected_files' or 'finder_search_files', which have different purposes.

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., file must exist), exclusions (e.g., unsupported file types), or compare it to other file operations in the sibling list. The user must infer usage from the purpose alone.

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/joshrutkowski/applescript-mcp'

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