Skip to main content
Glama
TrueOleg

MCP Mac Apps Server

by TrueOleg

open_file_with_app

Open files or URLs in specific macOS applications using this MCP server tool. Specify the file path and application name to launch content directly.

Instructions

Открывает файл или URL в указанном приложении

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesПуть к файлу или URL
appNameYesИмя приложения для открытия файла

Implementation Reference

  • TypeScript handler function that executes the open_file_with_app tool by running the 'open -a' command to open the specified path in the given app.
    private async openFileWithApp(path: string, appName: string) {
      try {
        await execAsync(`open -a "${appName}" "${path}"`);
        return {
          content: [
            {
              type: "text",
              text: `Файл "${path}" открыт в приложении "${appName}"`,
            },
          ],
        };
      } catch (error) {
        throw new Error(
          `Не удалось открыть файл: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Python handler function that executes the open_file_with_app tool using subprocess exec_command to run 'open -a' for opening file in app.
    def open_file_with_app(path: str, app_name: str) -> str:
        """Opens file in specified application"""
        stdout, stderr = exec_command(f'open -a "{app_name}" "{path}"')
        if stderr:
            raise Exception(f"Failed to open file: {stderr}")
        return f'File "{path}" opened in application "{app_name}"'
  • Input schema definition for the open_file_with_app tool in the TypeScript listTools response.
    {
      name: "open_file_with_app",
      description: "Открывает файл или URL в указанном приложении",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Путь к файлу или URL",
          },
          appName: {
            type: "string",
            description: "Имя приложения для открытия файла",
          },
        },
        required: ["path", "appName"],
      },
  • Input schema definition for the open_file_with_app tool in the Python get_tools() function.
    {
        "name": "open_file_with_app",
        "description": "Opens file or URL in specified application",
        "inputSchema": {
            "type": "object",
            "properties": {
                "path": {
                    "type": "string",
                    "description": "Path to file or URL",
                },
                "appName": {
                    "type": "string",
                    "description": "Application name to open file with",
                },
            },
            "required": ["path", "appName"],
        },
  • src/index.ts:323-327 (registration)
    Dispatch/registration case in TypeScript CallToolRequestSchema handler that routes to the openFileWithApp method.
    case "open_file_with_app":
      return await this.openFileWithApp(
        args?.path as string,
        args?.appName as string
      );
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 states the tool opens files/URLs in apps but doesn't disclose behavioral traits like whether it launches new app instances, handles errors, requires specific permissions, or has side effects. For a tool that interacts with system applications, this lack of transparency is a significant gap.

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 in Russian that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 complexity of interacting with system applications and the lack of annotations and output schema, the description is incomplete. It doesn't cover what happens on success/failure, return values, or error conditions. For a tool with potential side effects, more context is needed.

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 fully documents both parameters ('path' and 'appName'). The description adds no additional meaning beyond what's in the schema, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate.

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 ('Открывает' - opens) and the target ('файл или URL' - file or URL) with the means ('в указанном приложении' - in the specified application). It's specific about what the tool does but doesn't explicitly differentiate from sibling tools like 'open_application' or 'run_applescript' that might have overlapping functionality.

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, when not to use it, or compare it to siblings like 'open_application' or 'run_applescript' that might handle similar tasks. Usage is implied but not explicitly defined.

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/TrueOleg/MCP-expirements'

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