Skip to main content
Glama
masamunet

npm-dev-mcp

by masamunet

get_health_status

Check the health status of the npm-dev-mcp server to monitor background processes and ensure development environments are running properly. Use the detailed parameter for comprehensive reports.

Instructions

MCPサーバーのヘルス状態を取得

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailedNo詳細なヘルスレポートを取得するかどうか(デフォルト: false)

Implementation Reference

  • The main execution logic for the get_health_status tool. Performs health checks using HealthChecker instance, supports detailed reports, returns JSON status.
    export async function getHealthStatus(args: { detailed?: boolean } = {}): Promise<string> {
      const logger = Logger.getInstance();
      const healthChecker = HealthChecker.getInstance();
      
      try {
        logger.info('Getting health status', { detailed: args.detailed });
        
        if (args.detailed) {
          // 詳細なヘルスレポートを取得
          const report = await healthChecker.generateHealthReport();
          
          logger.info('Generated detailed health report');
          
          return JSON.stringify({
            success: true,
            message: 'MCPサーバーの詳細ヘルス状態を取得しました',
            report: JSON.parse(report)
          });
        } else {
          // 基本的なヘルス状態を取得
          const status = await healthChecker.performHealthCheck();
          
          logger.info('Health status retrieved', { 
            isHealthy: status.isHealthy,
            devServerStatus: status.devServerStatus
          });
          
          return JSON.stringify({
            success: true,
            message: `MCPサーバーは${status.isHealthy ? '正常' : '異常'}状態です`,
            health: {
              isHealthy: status.isHealthy,
              uptime: Math.floor(status.uptime / 1000),
              devServerStatus: status.devServerStatus,
              memoryUsage: {
                heapUsed: Math.floor(status.memoryUsage.heapUsed / 1024 / 1024),
                rss: Math.floor(status.memoryUsage.rss / 1024 / 1024)
              },
              checks: status.checks,
              lastError: status.lastError,
              timestamp: status.timestamp
            }
          });
        }
        
      } catch (error) {
        logger.error('Failed to get health status', { error });
        
        return JSON.stringify({
          success: false,
          message: `ヘルス状態の取得に失敗しました: ${error}`,
          error: String(error)
        });
      }
    }
  • Input schema and metadata definition for the get_health_status tool, defining optional 'detailed' boolean parameter.
    export const getHealthStatusSchema: Tool = {
      name: 'get_health_status',
      description: 'MCPサーバーのヘルス状態を取得',
      inputSchema: {
        type: 'object',
        properties: {
          detailed: {
            type: 'boolean',
            description: '詳細なヘルスレポートを取得するかどうか(デフォルト: false)',
            default: false
          }
        },
        additionalProperties: false
      }
    };
  • src/index.ts:187-195 (registration)
    Registration and dispatch of get_health_status handler in the main CallToolRequestSchema switch statement.
    case 'get_health_status':
      return {
        content: [
          {
            type: 'text',
            text: await getHealthStatus(args as { detailed?: boolean }),
          },
        ],
      };
  • src/index.ts:55-65 (registration)
    Inclusion of getHealthStatusSchema in the tools array used for ListToolsRequestSchema response.
    const tools = [
      scanProjectDirsSchema,
      startDevServerSchema,
      getDevStatusSchema,
      getDevLogsSchema,
      stopDevServerSchema,
      restartDevServerSchema,
      getHealthStatusSchema,
      recoverFromStateSchema,
      autoRecoverSchema,
    ];
  • Dependency mapping for get_health_status tool, requiring 'healthChecker' service before execution.
    export const SERVICE_DEPENDENCIES = {
      'scan_project_dirs': ['projectContext'],
      'start_dev_server': ['stateManager'],
      'get_dev_status': ['stateManager'],
      'get_dev_logs': ['stateManager'],
      'stop_dev_server': ['stateManager'],
      'restart_dev_server': ['stateManager'],
      'get_health_status': ['healthChecker'],
      'recover_from_state': ['stateManager'],
      'auto_recover': ['stateManager', 'healthChecker']
    } as const;
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 states the tool retrieves health status but doesn't describe what that includes (e.g., uptime, resource usage, error counts), whether it's a read-only operation, if it has side effects, or any rate limits. For a health-check tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 in Japanese: 'MCPサーバーのヘルス状態を取得'. It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every word earns its place.

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

Completeness2/5

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

Given the tool's simplicity (1 parameter, 100% schema coverage) and lack of annotations or output schema, the description is incomplete. It doesn't explain what health status entails, how it differs from sibling tools like 'get_dev_status', or what the return value looks like. For a health-check tool in a server management context, more context is needed to guide effective use.

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 input schema has 100% description coverage, with the 'detailed' parameter fully documented in the schema. The description doesn't add any parameter semantics beyond what the schema provides (e.g., it doesn't explain what 'detailed' health reports include). With high schema coverage, the baseline is 3, as the schema does the heavy lifting.

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: 'MCPサーバーのヘルス状態を取得' (Get MCP server health status). It specifies the verb '取得' (get) and resource 'ヘルス状態' (health status), making the action clear. However, it doesn't differentiate from sibling tools like 'get_dev_status' or 'get_dev_logs', which also retrieve status information.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_dev_status' (which might provide different status information) or 'auto_recover' (which might handle health issues). There's no context about prerequisites, timing, or exclusions.

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/masamunet/npm-dev-mcp'

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