Skip to main content
Glama

launch_mac_app

Executes a macOS application by specifying its path. Requires the appPath parameter; supports additional arguments for app execution. Part of the XcodeBuildMCP server.

Instructions

Launches a macOS application. IMPORTANT: You MUST provide the appPath parameter. Example: launch_mac_app({ appPath: '/path/to/your/app.app' }) Note: In some environments, this tool may be prefixed as mcp0_launch_macos_app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appPathYesPath to the macOS .app bundle to launch (full path to the .app directory)
argsNoAdditional arguments to pass to the app

Implementation Reference

  • The main handler function launch_mac_appLogic that validates the app path, constructs the 'open' command with optional args, executes it, and returns success or error response.
    export async function launch_mac_appLogic(
      params: LaunchMacAppParams,
      executor: CommandExecutor,
      fileSystem?: FileSystemExecutor,
    ): Promise<ToolResponse> {
      // Validate that the app file exists
      const fileExistsValidation = validateFileExists(params.appPath, fileSystem);
      if (!fileExistsValidation.isValid) {
        return fileExistsValidation.errorResponse!;
      }
    
      log('info', `Starting launch macOS app request for ${params.appPath}`);
    
      try {
        // Construct the command as string array for CommandExecutor
        const command = ['open', params.appPath];
    
        // Add any additional arguments if provided
        if (params.args && Array.isArray(params.args) && params.args.length > 0) {
          command.push('--args', ...params.args);
        }
    
        // Execute the command using CommandExecutor
        await executor(command, 'Launch macOS App');
    
        // Return success response
        return {
          content: [
            {
              type: 'text',
              text: `✅ macOS app launched successfully: ${params.appPath}`,
            },
          ],
        };
      } catch (error) {
        // Handle errors
        const errorMessage = error instanceof Error ? error.message : String(error);
        log('error', `Error during launch macOS app operation: ${errorMessage}`);
        return {
          content: [
            {
              type: 'text',
              text: `❌ Launch macOS app operation failed: ${errorMessage}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema defining input parameters: appPath (string, required), args (optional array of strings).
    const launchMacAppSchema = z.object({
      appPath: z
        .string()
        .describe('Path to the macOS .app bundle to launch (full path to the .app directory)'),
      args: z.array(z.string()).optional().describe('Additional arguments to pass to the app'),
    });
  • Tool registration exporting the tool object with name 'launch_mac_app', description, schema, and wrapped handler.
    export default {
      name: 'launch_mac_app',
      description:
        "Launches a macOS application. IMPORTANT: You MUST provide the appPath parameter. Example: launch_mac_app({ appPath: '/path/to/your/app.app' }) Note: In some environments, this tool may be prefixed as mcp0_launch_macos_app.",
      schema: launchMacAppSchema.shape, // MCP SDK compatibility
      handler: createTypedTool(launchMacAppSchema, launch_mac_appLogic, getDefaultCommandExecutor),
    };
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 mentions that 'appPath' is required and gives an example, but doesn't disclose important behavioral traits like whether this requires specific permissions, what happens if the app fails to launch, whether it runs in the background or foreground, or any system dependencies. The note about environment prefixes adds some context but not behavioral insight.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences: a clear purpose statement, an important requirement with example, and an environmental note. It's front-loaded with the core functionality. The environmental note could be considered slightly extraneous but provides useful implementation context.

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 that this is a mutation tool (launching applications) with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and parameter requirement but lacks information about what happens after launch, error conditions, or system requirements. The 100% schema coverage helps, but for a tool that interacts with the operating system, more behavioral context would be beneficial.

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 fully documents both parameters. The description adds value by emphasizing that 'appPath' is required and providing an example format, but doesn't add significant meaning beyond what the schema provides (e.g., explaining what constitutes a valid .app bundle path or how 'args' are processed).

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 ('Launches') and target ('a macOS application'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'launch_app_device' or 'launch_app_sim', which appear to launch applications on different platforms or environments.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage guidance by emphasizing that 'appPath' is required and giving an example, but it doesn't explicitly state when to use this tool versus alternatives like 'launch_app_device' or 'launch_app_sim'. The context is implied (macOS-specific launching) but not contrasted with sibling tools.

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

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/getsentry/XcodeBuildMCP'

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