Skip to main content
Glama
basementstudio

MCP DOS - Classic DOS Gaming Server

close-app

Read-onlyDestructiveIdempotent

Close a running DOS gaming server to resolve startup errors and free system resources for new game sessions.

Instructions

Close an existing running mcp-dos server. You can use this tool if you are getting erros when starting a new server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYesThe port of the app to close.

Implementation Reference

  • The main handler function for the 'close-app' tool. It performs a GET request to http://localhost:${port}/close to shut down the server and returns a response with success or error message.
    export default async function closeApp({ port }: InferSchema<typeof schema>) {
      try {
        const response = await fetch(`http://localhost:${port}/close`, {
          method: "GET",
        });
        const data = await response.text();
    
        return {
          content: [
            {
              type: "text",
              text: `Closed server on port ${port}`,
            },
            {
              type: "text",
              text: data,
            }
          ],
        }
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error closing server on port ${port}: ${error}`,
            },
          ],
        }
      }
    }
  • Input schema defining the 'port' parameter as a number.
    export const schema = {
      port: z.number().describe("The port of the app to close."),
    };
  • Tool metadata registration including name, description, and annotations.
    export const metadata = {
      name: "close-app",
      description: "Close an existing running mcp-dos server. You can use this tool if you are getting erros when starting a new server.",
      annotations: {
        title: "Close app",
        readOnlyHint: true,
        destructiveHint: true,
        idempotentHint: true,
      },
    };
  • HTTP endpoints (/close GET and POST) that the close-app tool calls to actually close the server instance.
    app.get('/close', (req, res) => {
      getGlobalServer()?.close();
      res.send('Server closed');
    });
    
    app.post('/close', (req, res) => {
      getGlobalServer()?.close();
      res.send('Server closed');
Behavior3/5

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

Annotations already indicate readOnlyHint=true, idempotentHint=true, and destructiveHint=true, covering key behavioral traits. The description adds context about closing a server to resolve errors, which is useful but doesn't elaborate on effects like termination or cleanup beyond what annotations imply.

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 two sentences, front-loaded with the main action and followed by usage guidance. Every sentence adds value without redundancy, making it efficient and well-structured.

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 the tool's complexity (simple destructive operation), rich annotations, and no output schema, the description is mostly complete. It explains the purpose and usage context but could benefit from more detail on what 'close' entails (e.g., termination effects) to fully compensate for the lack of output schema.

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%, with the parameter 'port' fully documented in the schema. The description doesn't add any additional meaning or details about the parameter beyond what the schema provides, so it meets the baseline for high coverage.

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 ('Close') and resource ('existing running mcp-dos server'), making the purpose understandable. However, it doesn't explicitly distinguish this tool from its sibling 'open-dos' beyond the opposite action, missing a direct comparison that would warrant a 5.

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 provides explicit guidance on when to use this tool: 'if you are getting erros when starting a new server.' This gives a clear context for usage, helping the agent decide when to invoke it versus alternatives, though it doesn't name specific siblings.

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/basementstudio/mcp-dos'

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