Skip to main content
Glama

system_launch_app

Launch macOS applications by name using AppleScript automation through the MCP server.

Instructions

[System control and information] Launch an application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesApplication name

Implementation Reference

  • Handler implementation for the 'system_launch_app' tool. This defines the AppleScript template that launches or activates the specified application by name, handling errors.
    {
      name: "launch_app",
      description: "Launch an application",
      schema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Application name",
          },
        },
        required: ["name"],
      },
      script: (args) => `
            try
              tell application "${args.name}"
                activate
              end tell
              return "Application ${args.name} launched successfully"
            on error errMsg
              return "Failed to launch application: " & errMsg
            end try
          `,
    },
  • Input schema for 'system_launch_app' tool, requiring the application 'name' as a string.
    schema: {
      type: "object",
      properties: {
        name: {
          type: "string",
          description: "Application name",
        },
      },
      required: ["name"],
    },
  • src/index.ts:25-25 (registration)
    Registration of the 'system' category, which includes the 'launch_app' script that becomes the 'system_launch_app' tool.
    server.addCategory(systemCategory);
  • Tool registration in listTools handler, constructing tool name as 'category_script' e.g. 'system_launch_app'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      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: {},
          },
        })),
      ),
    }));
  • Core execution handler for all tools including 'system_launch_app'. Parses tool name by splitting on '_', retrieves category/script, generates script content, and executes it via osascript.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      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
    
        const category = this.categories.find((c) => c.name === categoryName);
        if (!category) {
          this.log("warning", "Category not found", { categoryName });
          throw new McpError(
            ErrorCode.MethodNotFound,
            `Category not found: ${categoryName}`,
          );
        }
    
        const script = category.scripts.find((s) => s.name === scriptName);
        if (!script) {
          this.log("warning", "Script not found", { 
            categoryName, 
            scriptName 
          });
          throw new McpError(
            ErrorCode.MethodNotFound,
            `Script not found: ${scriptName}`,
          );
        }
    
        this.log("debug", "Generating script content", { 
          categoryName, 
          scriptName,
          isFunction: typeof script.script === "function"
        });
        
        const scriptContent =
          typeof script.script === "function"
            ? script.script(request.params.arguments)
            : script.script;
    
        const result = await this.executeScript(scriptContent);
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action but doesn't disclose behavioral traits such as permissions required (e.g., user consent, accessibility settings), side effects (e.g., app opens in foreground, may trigger notifications), or limitations (e.g., rate limits, app availability). This leaves the agent guessing about execution risks.

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 brief and front-loaded with the core action. However, the bracketed prefix '[System control and information]' is redundant and doesn't add value, slightly reducing efficiency. It's otherwise concise with no wasted sentences.

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 no annotations, no output schema, and a single parameter with full schema coverage, the description is incomplete. It fails to address key contextual aspects like what happens on launch (success/failure feedback), error conditions, or system dependencies, making it inadequate for safe agent use.

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%, with the parameter 'name' documented as 'Application name'. The description adds no meaning beyond this, such as format examples (e.g., 'Safari', 'com.apple.Safari'), validation rules, or how it resolves ambiguities. Baseline 3 is appropriate since the schema does the heavy lifting.

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 states the action ('Launch') and resource ('an application'), but it's vague about scope and lacks specificity. The prefix '[System control and information]' is generic and doesn't clarify what 'system' refers to (e.g., macOS, OS-level). It doesn't distinguish from sibling tools like 'system_quit_app' or 'system_get_frontmost_app' beyond the verb.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., app must be installed), exclusions (e.g., cannot launch system processes), or compare to siblings like 'shortcuts_run_shortcut' for automation. The description offers no context for selection.

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