Skip to main content
Glama

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

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, }, }; }, );

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