Skip to main content
Glama

pursIdeQuit

Gracefully shut down the PureScript IDE server using its built-in quit command, ensuring resource release without abrupt termination.

Instructions

Gracefully shut down the IDE server and free up resources. PREREQUISITE: IDE server must be running. Same effect as stop_purs_ide_server but uses the server's built-in quit command first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'pursIdeQuit' tool. It attempts to send a 'quit' command to the running purs ide server, waits briefly, kills the process if necessary, updates state variables, and returns a success response with a detailed status message.
    "pursIdeQuit": async () => {
        let quitMessage = "purs ide server quit command initiated.";
        let pursIdeResponded = false;
    
        if (pursIdeProcess && pursIdeIsReady) {
            logToStderr("[pursIdeQuit] Attempting to send 'quit' command to purs ide server.", "debug");
            sendCommandToPursIde({ command: "quit" })
                .then(res => {
                    pursIdeResponded = true;
                    logToStderr(`[pursIdeQuit] purs ide server responded to quit command: ${JSON.stringify(res)}`, 'debug');
                })
                .catch(err => {
                    logToStderr(`[pursIdeQuit] Error/No response from purs ide server for quit command: ${err.message}`, 'warn');
                });
            
            // Wait a short period to allow purs ide server to shut down gracefully
            // or for the sendCommandToPursIde to potentially resolve/reject.
            await delay(250); // Increased slightly to 250ms
        } else {
            quitMessage = "No purs ide server was running or ready to send quit command to.";
            logToStderr("[pursIdeQuit] " + quitMessage, "info");
        }
    
        // Ensure our managed process is stopped regardless of purs ide's response
        if (pursIdeProcess) {
            logToStderr("[pursIdeQuit] Ensuring managed purs ide process is stopped.", "debug");
            pursIdeProcess.kill();
            pursIdeProcess = null;
            pursIdeIsReady = false;
            logPursIdeOutput("Managed purs ide server process stopped via pursIdeQuit tool.", "info");
            quitMessage += " Managed purs ide process has been stopped.";
        } else {
            if (!quitMessage.includes("No purs ide server was running")) {
                 quitMessage += " No managed purs ide process was found running to stop.";
            }
        }
        
        if (pursIdeResponded) {
            quitMessage += " purs ide server acknowledged quit.";
        } else {
            quitMessage += " purs ide server may not have acknowledged quit before process termination.";
        }
    
        return { content: [{ type: "text", text: JSON.stringify({ status_message: quitMessage, resultType: "success" }, null, 2) }] };
    },
  • The tool schema definition for 'pursIdeQuit', including name, description, and input schema (empty object). This is part of the TOOL_DEFINITIONS array returned by the 'tools/list' MCP method.
        name: "pursIdeQuit",
        description: "Gracefully shut down the IDE server and free up resources. PREREQUISITE: IDE server must be running. Same effect as stop_purs_ide_server but uses the server's built-in quit command first.",
        inputSchema: { type: "object", properties: {}, additionalProperties: false }
    },
    {
  • index.js:1044-1088 (registration)
    Registration of the 'pursIdeQuit' handler in the INTERNAL_TOOL_HANDLERS object, which is used in 'tools/call' to dispatch to the correct function based on tool name.
    "pursIdeQuit": async () => {
        let quitMessage = "purs ide server quit command initiated.";
        let pursIdeResponded = false;
    
        if (pursIdeProcess && pursIdeIsReady) {
            logToStderr("[pursIdeQuit] Attempting to send 'quit' command to purs ide server.", "debug");
            sendCommandToPursIde({ command: "quit" })
                .then(res => {
                    pursIdeResponded = true;
                    logToStderr(`[pursIdeQuit] purs ide server responded to quit command: ${JSON.stringify(res)}`, 'debug');
                })
                .catch(err => {
                    logToStderr(`[pursIdeQuit] Error/No response from purs ide server for quit command: ${err.message}`, 'warn');
                });
            
            // Wait a short period to allow purs ide server to shut down gracefully
            // or for the sendCommandToPursIde to potentially resolve/reject.
            await delay(250); // Increased slightly to 250ms
        } else {
            quitMessage = "No purs ide server was running or ready to send quit command to.";
            logToStderr("[pursIdeQuit] " + quitMessage, "info");
        }
    
        // Ensure our managed process is stopped regardless of purs ide's response
        if (pursIdeProcess) {
            logToStderr("[pursIdeQuit] Ensuring managed purs ide process is stopped.", "debug");
            pursIdeProcess.kill();
            pursIdeProcess = null;
            pursIdeIsReady = false;
            logPursIdeOutput("Managed purs ide server process stopped via pursIdeQuit tool.", "info");
            quitMessage += " Managed purs ide process has been stopped.";
        } else {
            if (!quitMessage.includes("No purs ide server was running")) {
                 quitMessage += " No managed purs ide process was found running to stop.";
            }
        }
        
        if (pursIdeResponded) {
            quitMessage += " purs ide server acknowledged quit.";
        } else {
            quitMessage += " purs ide server may not have acknowledged quit before process termination.";
        }
    
        return { content: [{ type: "text", text: JSON.stringify({ status_message: quitMessage, resultType: "success" }, null, 2) }] };
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior ('Gracefully shut down... and free up resources'), prerequisite condition, and how it differs from an alternative tool. However, it doesn't mention potential side effects like whether unsaved work might be lost or if there's a confirmation step, leaving some behavioral aspects unclear.

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 perfectly concise with two sentences that each earn their place: the first states the core action and resource, the second provides prerequisite and sibling comparison. There's no wasted language, and information is front-loaded effectively.

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

Completeness4/5

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

Given this is a shutdown tool with 0 parameters and no annotations or output schema, the description provides good contextual completeness by explaining the action, prerequisite, and sibling relationship. However, it doesn't mention what happens after shutdown (e.g., confirmation message, error handling), which would make it more complete for a server control tool.

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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's core functionality without unnecessary details.

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 clearly states the tool's purpose with a specific verb ('Gracefully shut down') and resource ('the IDE server'), and explicitly distinguishes it from its sibling tool 'stop_purs_ide_server' by noting it uses the server's built-in quit command first. This provides clear differentiation and avoids tautology.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('PREREQUISITE: IDE server must be running') and provides a direct alternative ('Same effect as stop_purs_ide_server but uses the server's built-in quit command first'), giving clear guidance on when to choose this tool over its sibling.

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/avi892nash/purescript-mcp-tools'

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