Skip to main content
Glama
gfb-47

WhatsApp MCP Server

by gfb-47

check-whatsapp-status

Verify WhatsApp desktop application status on macOS to determine if it's currently running and accessible for automation tasks.

Instructions

Check if WhatsApp is currently running

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:143-180 (registration)
    Registration of the 'check-whatsapp-status' MCP tool, including its inline handler function that uses AppleScript to check if the WhatsApp process exists.
    server.tool(
      "check-whatsapp-status",
      "Check if WhatsApp is currently running",
      {},
      async () => {
        try {
          const appleScript = `
            tell application "System Events"
              return (exists process "WhatsApp")
            end tell
          `;
    
          const result = await runAppleScript(appleScript);
          const isRunning = result.toLowerCase() === 'true';
    
          return {
            content: [
              {
                type: "text",
                text: isRunning
                  ? "WhatsApp is currently running."
                  : "WhatsApp is not currently running. Please start WhatsApp before trying to send messages.",
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error checking WhatsApp status: ${error}`,
              }
            ],
            isError: true
          };
        }
      }
    );
  • Helper function to execute AppleScript code, which is called by the tool handler to check WhatsApp status.
    async function runAppleScript(script: string) {
      try {
        const { stdout } = await execPromise(`osascript -e '${script.replace(/'/g, "'\\''")}'`);
        return stdout.trim();
      } catch (error) {
        console.error("AppleScript execution error:", error);
        throw new Error(`Failed to execute AppleScript: ${error}`);
      }
    }
  • Promisified exec function used by runAppleScript helper.
    const execPromise = promisify(exec);
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 checks if WhatsApp is 'currently running,' which implies a read-only operation, but doesn't disclose behavioral traits like what 'running' means (e.g., process active, logged in), error handling, or performance characteristics. The description is minimal and lacks context beyond the basic purpose.

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 purpose without any wasted words. It is 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.

Completeness3/5

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

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or usage context, which could be helpful for an agent to understand what 'running' entails or how to interpret results.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, and it doesn't contradict the schema. Baseline is 4 for tools with no parameters, as there's nothing to compensate for.

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 ('Check if') and resource ('WhatsApp'), specifying what the tool does. It distinguishes from siblings like 'send-whatsapp-message' by focusing on status checking rather than messaging, though it doesn't explicitly mention the sibling 'list-recent-contacts'.

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. The description implies usage for checking WhatsApp's operational status, but it doesn't specify scenarios, prerequisites, or exclusions, such as whether it requires WhatsApp to be installed or configured.

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/gfb-47/whatsapp-mcp-server'

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