Skip to main content
Glama
VetCoders

automator-mcp

by VetCoders

quick_action

Execute predefined file automation tasks like compressing images, converting to PDF, resizing images, extracting text, combining PDFs, or converting video files on macOS.

Instructions

Run a predefined quick action

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesQuick action to perform
filesYesFile paths to process
optionsNoAction-specific options

Implementation Reference

  • The primary handler for the 'quick_action' tool. It destructures the input arguments, defines a mapping of quick actions to their implementations (which use AppleScript), and executes the specified action on the provided files.
    async runQuickAction(args) {
      const { action, files, options = {} } = args;
      
      const quickActions = {
        compress_images: async () => {
          const script = `
            tell application "Finder"
              set theFiles to {${files.map(f => `POSIX file "${f}"`).join(', ')}}
            end tell
            
            repeat with theFile in theFiles
              do shell script "sips -Z 1024 " & quoted form of POSIX path of theFile
            end repeat
          `;
          return this.runAppleScript(script);
        },
        
        convert_to_pdf: async () => {
          const outputPath = options.outputPath || files[0].replace(/\.[^.]+$/, '.pdf');
          const script = `
            do shell script "convert ${files.map(f => `'${f}'`).join(' ')} '${outputPath}'"
          `;
          return this.runAppleScript(script);
        },
        
        resize_images: async () => {
          const size = options.size || '800x600';
          const script = `
            repeat with filePath in {${files.map(f => `"${f}"`).join(', ')}}
              do shell script "sips -z ${size.split('x')[1]} ${size.split('x')[0]} " & filePath
            end repeat
          `;
          return this.runAppleScript(script);
        },
      };
      
      if (quickActions[action]) {
        return await quickActions[action]();
      }
      
      throw new Error(`Unknown quick action: ${action}`);
    }
  • Input schema for the 'quick_action' tool, defining the expected parameters: 'action' (enum of available quick actions), 'files' (array of file paths, required), and optional 'options'.
    inputSchema: {
      type: 'object',
      properties: {
        action: {
          type: 'string',
          enum: [
            'compress_images',
            'convert_to_pdf',
            'resize_images',
            'extract_text_from_pdf',
            'combine_pdfs',
            'convert_video',
          ],
          description: 'Quick action to perform',
        },
        files: {
          type: 'array',
          items: { type: 'string' },
          description: 'File paths to process',
        },
        options: {
          type: 'object',
          description: 'Action-specific options',
        },
      },
      required: ['action', 'files'],
    },
  • src/index.js:108-138 (registration)
    Registration of the 'quick_action' tool in the listTools handler response, including name, description, and full input schema.
    {
      name: 'quick_action',
      description: 'Run a predefined quick action',
      inputSchema: {
        type: 'object',
        properties: {
          action: {
            type: 'string',
            enum: [
              'compress_images',
              'convert_to_pdf',
              'resize_images',
              'extract_text_from_pdf',
              'combine_pdfs',
              'convert_video',
            ],
            description: 'Quick action to perform',
          },
          files: {
            type: 'array',
            items: { type: 'string' },
            description: 'File paths to process',
          },
          options: {
            type: 'object',
            description: 'Action-specific options',
          },
        },
        required: ['action', 'files'],
      },
    },
  • src/index.js:187-188 (registration)
    Handler dispatch registration in the CallToolRequestHandler switch statement, routing 'quick_action' calls to the runQuickAction method.
    case 'quick_action':
      return await this.runQuickAction(args);
  • Helper mapping object within the handler that defines implementations for specific quick actions like compress_images, convert_to_pdf, and resize_images using AppleScript.
    const quickActions = {
      compress_images: async () => {
        const script = `
          tell application "Finder"
            set theFiles to {${files.map(f => `POSIX file "${f}"`).join(', ')}}
          end tell
          
          repeat with theFile in theFiles
            do shell script "sips -Z 1024 " & quoted form of POSIX path of theFile
          end repeat
        `;
        return this.runAppleScript(script);
      },
      
      convert_to_pdf: async () => {
        const outputPath = options.outputPath || files[0].replace(/\.[^.]+$/, '.pdf');
        const script = `
          do shell script "convert ${files.map(f => `'${f}'`).join(' ')} '${outputPath}'"
        `;
        return this.runAppleScript(script);
      },
      
      resize_images: async () => {
        const size = options.size || '800x600';
        const script = `
          repeat with filePath in {${files.map(f => `"${f}"`).join(', ')}}
            do shell script "sips -z ${size.split('x')[1]} ${size.split('x')[0]} " & filePath
          end repeat
        `;
        return this.runAppleScript(script);
      },
    };
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 of behavioral disclosure. It states 'Run a predefined quick action', implying a mutation or processing operation, but doesn't disclose critical traits like whether it modifies files in place, requires authentication, has rate limits, or what happens on failure. This is a significant gap for a tool with potential destructive effects, as it doesn't add context beyond the basic action.

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: 'Run a predefined quick action'. It's front-loaded with the core purpose and has zero wasted words, making it easy to parse quickly. Every part of the sentence earns its place by conveying the essential action.

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 (3 parameters, including nested objects, no output schema, and no annotations), the description is incomplete. It doesn't explain what 'predefined' entails, the scope of actions (e.g., file processing as hinted by enum), or behavioral outcomes. Without annotations or output schema, more context is needed to guide safe and effective use, especially for a mutation tool.

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 (action, files, options) with descriptions and an enum for action. The description adds no meaning beyond this, such as explaining what 'predefined' means or how options are structured. With high schema coverage, the baseline is 3, as the description doesn't compensate but also doesn't detract.

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 'Run a predefined quick action' states the verb ('run') and resource ('predefined quick action'), but it's vague about what a 'quick action' entails—it could be any automated task without specifying the domain (e.g., file processing). It doesn't distinguish from siblings like 'create_workflow' or 'system_automation', which might involve similar automation. However, it avoids tautology by not merely restating the name 'quick_action'.

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, such as needing specific file types or permissions, or compare it to siblings like 'run_applescript' or 'list_actions'. Usage is implied only through the action parameter's enum values, but the description itself lacks explicit when/when-not statements or named alternatives.

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/VetCoders/automator-mcp'

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