Skip to main content
Glama

system_quit_app

Quit macOS applications using AppleScript commands. Specify the application name and optionally force quit if needed.

Instructions

[System control and information] Quit an application

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesApplication name
forceNoForce quit if true

Implementation Reference

  • Core implementation of the 'quit_app' script in the 'system' category. This defines the input schema, generates the AppleScript code based on arguments, and handles the quit logic. Tool name becomes 'system_quit_app' via category prefixing.
    {
      name: "quit_app",
      description: "Quit an application",
      schema: {
        type: "object",
        properties: {
          name: {
            type: "string",
            description: "Application name",
          },
          force: {
            type: "boolean",
            description: "Force quit if true",
            default: false,
          },
        },
        required: ["name"],
      },
      script: (args) => `
            try
              tell application "${args.name}"
                ${args.force ? "quit saving no" : "quit"}
              end tell
              return "Application ${args.name} quit successfully"
            on error errMsg
              return "Failed to quit application: " & errMsg
            end try
          `,
    },
  • Input schema for the quit_app tool, specifying the application name (required) and optional force flag.
    schema: {
      type: "object",
      properties: {
        name: {
          type: "string",
          description: "Application name",
        },
        force: {
          type: "boolean",
          description: "Force quit if true",
          default: false,
        },
      },
      required: ["name"],
    },
  • Registers the MCP tool 'system_quit_app' by constructing tool names as '{category}_{script}' (e.g., system_quit_app) and listing them with descriptions and schemas.
    // List available tools
    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: {},
          },
        })),
      ),
    }));
  • Helper logic to parse tool name 'system_quit_app' into category 'system' and script 'quit_app' during tool execution.
    // Split on underscore instead of dot
    const [categoryName, ...scriptNameParts] =
      toolName.split("_");
    const scriptName = scriptNameParts.join("_"); // Rejoin in case script name has underscores
  • src/index.ts:2-25 (registration)
    Imports the system category (containing quit_app) and registers it with the framework server.
    import { systemCategory } from "./categories/system.js";
    import { calendarCategory } from "./categories/calendar.js";
    import { finderCategory } from "./categories/finder.js";
    import { clipboardCategory } from "./categories/clipboard.js";
    import { notificationsCategory } from "./categories/notifications.js";
    import { itermCategory } from "./categories/iterm.js";
    import { mailCategory } from "./categories/mail.js";
    import { pagesCategory } from "./categories/pages.js";
    import { shortcutsCategory } from "./categories/shortcuts.js";
    import { messagesCategory } from "./categories/messages.js";
    import { notesCategory } from "./categories/notes.js";
    
    const server = new AppleScriptFramework({
      name: "applescript-server",
      version: "1.0.4",
      debug: false,
    });
    
    // Log startup information using stderr (server isn't connected yet)
    console.error(`[INFO] Starting AppleScript MCP server - PID: ${process.pid}`);
    
    // Add all categories
    console.error("[INFO] Registering categories...");
    server.addCategory(systemCategory);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Quit an application' implies a destructive action but doesn't specify consequences (e.g., unsaved data loss), permissions needed, or system impacts. The force parameter hints at behavioral nuance but isn't explained in the description itself.

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 extremely concise ('Quit an application') and front-loaded. The bracketed prefix '[System control and information]' provides context but could be considered slightly redundant with the tool name. Overall, it's efficient with minimal waste.

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?

For a destructive system control tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'quit' entails operationally, success/failure conditions, or return values. The agent lacks critical context needed to use this tool safely and effectively.

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%, providing complete parameter documentation. The description adds no parameter semantics beyond what's in the schema (name=application name, force=force quit). This meets the baseline for high schema coverage but doesn't enhance understanding (e.g., what constitutes a valid application name).

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 'Quit an application' clearly states the verb (quit) and resource (application), making the purpose immediately understandable. It distinguishes from siblings like system_launch_app (launch vs quit) and system_get_frontmost_app (get vs quit). However, it doesn't specify scope (e.g., frontmost app vs any app) which prevents a perfect score.

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 (e.g., app must be running), when force quitting is appropriate, or compare to other system control tools. The agent must infer usage from the tool 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

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