Skip to main content
Glama

open_application

Destructive

Launch macOS applications by name or bundle identifier with fuzzy matching support for quick access to desktop software.

Instructions

Launch an application by name or bundle identifier. App name supports fuzzy matching (e.g. 'chrome' → 'Google Chrome').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesApplication name (e.g. "Safari") or bundle identifier (e.g. "com.apple.Safari").

Implementation Reference

  • The handler function `handleOpenApplication` performs the logic to open an application using the `open` command, supporting both bundle identifiers and application names.
    async function handleOpenApplication(
      args: Record<string, unknown>,
    ): Promise<CallToolResult> {
      const parsed = OpenApplicationInputSchema.parse(args);
      // Skip resolution for bundle IDs — they must be passed verbatim
      const name = isBundleId(parsed.name)
        ? parsed.name
        : await resolveAppName(parsed.name);
    
      // Determine whether to use -a (app name) or -b (bundle ID)
      const flag = isBundleId(name) ? "-b" : "-a";
    
      try {
        await execFileAsync("open", [flag, name], {
          timeout: OPEN_COMMAND_TIMEOUT_MS,
        });
      } catch (error: unknown) {
        const msg = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                error: `Failed to open application "${name}": ${msg}`,
              }),
            },
          ],
          isError: true,
        };
      }
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify({ success: true, app: name }),
          },
        ],
      };
    }
  • Zod schema definition for `open_application` input validation.
    const OpenApplicationInputSchema = z.object({
      name: z
        .string()
        .max(1_000)
        .describe(
          'Application name (e.g. "Safari") or bundle identifier (e.g. "com.apple.Safari").',
        ),
    });
  • Registration definition for the `open_application` tool.
      {
        name: "open_application",
        description:
          "Launch an application by name or bundle identifier. App name supports fuzzy matching (e.g. 'chrome' → 'Google Chrome').",
        inputSchema: zodToToolInputSchema(OpenApplicationInputSchema),
        annotations: {
          readOnlyHint: false,
          destructiveHint: true,
        },
      },
    ];
  • Handler mapping where `open_application` is connected to its handler via an enqueue wrapper.
    export const windowToolHandlers: Record<
      string,
      (args: Record<string, unknown>) => Promise<CallToolResult>
    > = {
      list_windows: (args) => enqueue(() => handleListWindows(args)),
      focus_window: (args) => enqueue(() => handleFocusWindow(args)),
      open_application: (args) => enqueue(() => handleOpenApplication(args)),
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond annotations by explaining the fuzzy matching feature and providing concrete examples. While annotations already indicate this is a destructive operation (destructiveHint: true), the description clarifies what 'destructive' means in this context - launching applications which changes system state. No contradiction with annotations exists.

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 perfectly concise with two sentences that each earn their place. The first sentence states the core functionality, and the second provides important behavioral detail about fuzzy matching with a helpful example. No wasted words.

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

Completeness4/5

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

For a single-parameter tool with good annotations and no output schema, the description is reasonably complete. It explains what the tool does, how to use it, and includes important behavioral details. However, it could benefit from mentioning potential failure modes or system requirements.

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?

With 100% schema description coverage, the input schema already fully documents the single parameter. The description adds minimal value beyond the schema by mentioning fuzzy matching, but doesn't provide additional semantic context about parameter constraints, format requirements, or edge cases.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Launch') and resource ('application'), and distinguishes it from siblings by focusing on application launching rather than UI automation or system queries. It provides concrete examples of what can be launched.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool (to launch applications by name or bundle ID) and mentions fuzzy matching capability. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for different scenarios.

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

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