Skip to main content
Glama

maintenance_mode

Enable or disable specific tools for maintenance simulation on the example-mcp-server-stdio. Manage tool availability with a simple boolean input.

Instructions

Simulate enabling or disabling tools for maintenance (demo only)

Input Schema

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

Implementation Reference

  • The handler function for the maintenance_mode tool. Simulates enabling or disabling a specified tool (calculate, batch_calculate, or advanced_calculate) 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 input schema for maintenance_mode tool defining 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 output schema for maintenance_mode tool defining status, toolName, enabled, and message fields.
    const maintenanceModeOutputSchema = { status: z.string(), toolName: z.string(), enabled: z.boolean(), message: z.string(), };
  • Registration of the maintenance_mode tool using server.registerTool within the registerManagementTools function, specifying name, metadata, schemas, and handler.
    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, }, }; }, );

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

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