Skip to main content
Glama
yigitkonur

example-mcp-server-stdio

by yigitkonur

Maintenance Mode

maintenance_mode

Enable or disable tools for maintenance periods to control availability and manage updates without affecting active operations.

Instructions

Simulate enabling or disabling tools for maintenance (demo only)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toolNameYesTool to simulate managing
enableYesEnable (true) or disable (false) the tool

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
enabledYes
messageYes
toolNameYes

Implementation Reference

  • The anonymous async function that implements the core logic of the 'maintenance_mode' tool. It simulates enabling or disabling specified tools by logging the action, incrementing a request counter, generating a status message, and returning both markdown text content and structured JSON output.
    async ({ toolName, enable }) => {
      log.info(`Simulating maintenance mode for ${toolName}: ${enable ? 'enabled' : 'disabled'}`);
      requestCount++;
    
      // NOTE: In a real implementation, this would use tool handles to actually
      // enable/disable tools. For this educational demo, we simulate the action.
    
      const message = enable
        ? `Tool '${toolName}' would be enabled and available for use.`
        : `Tool '${toolName}' would be disabled for maintenance and temporarily unavailable.`;
    
      return {
        content: [
          {
            type: 'text',
            text: `## Maintenance Mode (Demo)\n\n${message}\n\n**Note**: This is a demonstration tool. In a production server, this would use actual tool lifecycle management.`,
          },
        ],
        structuredContent: {
          status: enable ? 'enabled' : 'disabled',
          toolName,
          enabled: enable,
          message,
        },
      };
    },
  • Zod schema defining the input parameters for the 'maintenance_mode' tool: toolName (enum of calculator tools) and enable (boolean).
    const maintenanceModeInputSchema = {
      toolName: z
        .enum(['calculate', 'batch_calculate', 'advanced_calculate'])
        .describe('Tool to simulate managing'),
      enable: z.boolean().describe('Enable (true) or disable (false) the tool'),
    };
  • Zod schema defining the structured output for the 'maintenance_mode' tool: status, toolName, enabled, and message.
    const maintenanceModeOutputSchema = {
      status: z.string(),
      toolName: z.string(),
      enabled: z.boolean(),
      message: z.string(),
    };
  • The server.registerTool call that registers the 'maintenance_mode' tool, specifying its name, metadata (title, description), input/output schemas, and inline handler function.
    server.registerTool(
      'maintenance_mode',
      {
        title: 'Maintenance Mode',
        description: 'Simulate enabling or disabling tools for maintenance (demo only)',
        inputSchema: maintenanceModeInputSchema,
        outputSchema: maintenanceModeOutputSchema,
      },
      async ({ toolName, enable }) => {
        log.info(`Simulating maintenance mode for ${toolName}: ${enable ? 'enabled' : 'disabled'}`);
        requestCount++;
    
        // NOTE: In a real implementation, this would use tool handles to actually
        // enable/disable tools. For this educational demo, we simulate the action.
    
        const message = enable
          ? `Tool '${toolName}' would be enabled and available for use.`
          : `Tool '${toolName}' would be disabled for maintenance and temporarily unavailable.`;
    
        return {
          content: [
            {
              type: 'text',
              text: `## Maintenance Mode (Demo)\n\n${message}\n\n**Note**: This is a demonstration tool. In a production server, this would use actual tool lifecycle management.`,
            },
          ],
          structuredContent: {
            status: enable ? 'enabled' : 'disabled',
            toolName,
            enabled: enable,
            message,
          },
        };
      },
    );
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 of behavioral disclosure. It mentions 'simulate' and 'demo only', which hints that this is a non-destructive, mock operation, but it doesn't clarify what 'simulate' entails (e.g., whether it actually affects tool functionality, returns mock data, or has side effects). For a tool with no annotations, this leaves gaps in understanding its real-world impact and safety.

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, efficient sentence: 'Simulate enabling or disabling tools for maintenance (demo only)'. It's front-loaded with the core purpose and includes essential context without unnecessary details. Every word earns its place, making it highly concise 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 low complexity (2 parameters, 100% schema coverage, and an output schema exists), the description is reasonably complete. It covers the purpose and demo context, and with an output schema, it doesn't need to explain return values. However, for a tool with no annotations, it could benefit from more behavioral details (e.g., what 'simulate' means operationally) to be fully comprehensive.

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?

The description doesn't add any parameter-specific information beyond what the input schema provides. With 100% schema description coverage, the schema already documents 'toolName' and 'enable' parameters clearly, including enum values for 'toolName'. The baseline score of 3 is appropriate as the schema does the heavy lifting, and the description doesn't compensate with additional semantics.

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 tool's purpose: 'Simulate enabling or disabling tools for maintenance (demo only)'. It specifies the action ('enabling or disabling') and the target ('tools'), though it doesn't explicitly differentiate from sibling tools like 'demo_progress' that might also be for demos. The mention of 'maintenance' and 'demo only' adds context but doesn't fully distinguish it from other demo-related tools.

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?

The description implies usage context with 'demo only', suggesting this tool is for testing or demonstration purposes rather than production. However, it doesn't provide explicit guidance on when to use this vs. alternatives like 'demo_progress' or other sibling tools, nor does it specify prerequisites or exclusions. The implied context is helpful but lacks detailed alternatives.

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/yigitkonur/example-mcp-server-stdio'

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