Skip to main content
Glama

Quit App

quit_app
DestructiveIdempotent

Quit a running application on macOS by specifying its name.

Instructions

Quit a running application by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesApplication name (e.g. 'Safari')

Implementation Reference

  • Registration of the 'quit_app' tool on the MCP server with input schema (name parameter) and handler that calls quitAppScript via JXA.
    server.registerTool(
      "quit_app",
      {
        title: "Quit App",
        description: "Quit a running application by name. May cause unsaved work to be lost.",
        inputSchema: {
          name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari')"),
        },
        annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
      },
      async ({ name }) => {
        try {
          return ok(await runJxa(quitAppScript(name)));
        } catch (e) {
          return errJxaFor("quit app", e);
        }
      },
    );
  • The actual JXA script generator function that creates an AppleScript/JXA snippet to quit the specified application by name.
    export function quitAppScript(name: string): string {
      return `
        const app = Application('${esc(name)}');
        app.quit();
        JSON.stringify({quit: true, name: '${esc(name)}'});
      `;
    }
  • Input schema for the quit_app tool, requiring a string 'name' parameter with min/max constraints.
    inputSchema: {
      name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari')"),
    },
    annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
Behavior4/5

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

Description is consistent with annotations (destructiveHint: true, idempotentHint: true) and adds the context that quitting is by name. No contradiction.

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?

Single sentence with no wasted words, directly conveying the tool's action and scope.

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

Completeness5/5

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

Given the simplicity (one required param, no output schema), the description with annotations provides complete context for correct invocation.

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?

Input schema covers 100% of the parameter with its own description; the tool description adds no additional meaning beyond 'by name'.

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 'Quit a running application by name' uses a specific verb (Quit) and resource (running application), clearly distinguishing it from siblings like launch_app or is_app_running.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided; the usage is implied but alternatives like launch_app are not mentioned.

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/heznpc/AirMCP'

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