Skip to main content
Glama
eugenechen0514

mac-apps-launcher

open_with_app

Open files or folders directly with a specified application on macOS, streamlining access and improving workflow efficiency.

Instructions

Open a file or folder with a specific application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appNameYes
filePathYes

Implementation Reference

  • Implements the core logic to open a file with a specified macOS application using the 'open -a' command.
    export async function openWithApp(
      appName: string,
      filePath: string
    ): Promise<boolean> {
      try {
        const fullAppName = appName.endsWith(".app") ? appName : `${appName}.app`;
        const appPath = join("/Applications", fullAppName);
        await execAsync(`open -a "${appPath}" "${filePath}"`);
        return true;
      } catch (error) {
        console.error("Error opening file with application:", error);
        return false;
      }
    }
  • Zod schema for input validation of the open_with_app tool.
    export const OpenWithAppInputSchema = {
      appName: z.string(),
      filePath: z.string(),
    };
  • tools.ts:76-101 (registration)
    Registers the open_with_app tool with name, description, annotations, schema reference, and callback that invokes the handler.
    const openWithAppConfig: ToolConfig<typeof OpenWithAppInputSchema> = {
      name: "open_with_app",
      description: "Open a file or folder with a specific application",
      annotations: {
        title: "用應用程式開啟檔案",
        readOnlyHint: false, // 會修改系統狀態
        destructiveHint: false, // 不執行破壞性操作
        idempotentHint: false, // 重複開啟可能有不同結果
        openWorldHint: true, // 與外部應用程式和檔案互動
      },
      schema: OpenWithAppInputSchema,
      cb: async (args) => {
        const success = await openWithApp(args.appName, args.filePath);
        const toolResult: CallToolResult = {
          content: [
            {
              type: "text",
              text: success
                ? "File opened successfully"
                : "Failed to open file with application",
            },
          ],
        };
        return toolResult;
      },
    };
Behavior3/5

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

Annotations provide key behavioral hints: readOnlyHint=false (implies mutation), openWorldHint=true (suggests external app interaction), idempotentHint=false (non-idempotent), destructiveHint=false (safe). The description adds minimal context beyond this, stating the action but not detailing side effects (e.g., app launching, file locking) or constraints (e.g., app availability). It doesn't contradict annotations, but offers little extra 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.

Conciseness5/5

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

The description is a single, clear sentence that directly states the tool's function without unnecessary words. It's front-loaded and efficiently conveys the core purpose, making it easy for an agent to parse quickly.

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 (interacting with external apps, mutating state per annotations), lack of output schema, and poor parameter documentation, the description is insufficient. It doesn't address return values, error conditions, or practical usage details needed for reliable agent invocation, leaving significant gaps in understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the schema provides no parameter details. The description mentions 'appName' and 'filePath' implicitly but doesn't explain their semantics (e.g., format of filePath, valid app names). It fails to compensate for the schema's lack of documentation, leaving parameters largely undefined.

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 ('Open') and the target ('a file or folder with a specific application'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'launch_app' (which might launch an app without opening a file) or 'list_applications' (which lists apps), leaving room for ambiguity in tool selection.

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 like 'launch_app' or 'list_applications'. It lacks context about prerequisites (e.g., whether the app must be installed) or exclusions (e.g., not for remote files), leaving the agent to infer usage based on the name 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

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/eugenechen0514/mac-apps-launcher'

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