Skip to main content
Glama
masamunet

npm-dev-mcp

by masamunet

get_dev_status

Check the status of npm run dev processes to monitor project execution, logs, and port usage for development workflows.

Instructions

npm run devプロセスの状態確認

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that executes the get_dev_status tool. It retrieves the status of dev servers using ProcessManager, gathers process info including logs and errors, and returns a formatted JSON string.
    export async function getDevStatus(): Promise<string> {
      try {
        logger.debug('Getting dev server status');
    
        const processManager = ProcessManager.getInstance();
        const processes = await processManager.getStatus();
    
        if (processes.length === 0) {
          return JSON.stringify({
            success: true,
            message: 'Dev serverは起動していません',
            isRunning: false,
            processes: []
          });
        }
    
        const processesInfo = processes.map(status => {
          const logManager = processManager.getLogManager(status.directory);
          const logStats = logManager?.getLogStats();
          const hasRecentErrors = logManager?.hasRecentErrors() || false;
    
          return {
            pid: status.pid,
            directory: status.directory,
            status: status.status,
            startTime: status.startTime,
            ports: status.ports,
            uptime: Date.now() - status.startTime.getTime(),
            stats: logStats ? {
              errors: logStats.errors,
              warnings: logStats.warnings
            } : undefined,
            hasRecentErrors
          };
        });
    
        const result = {
          success: true,
          message: `${processes.length}個のDev serverが稼働中です`,
          isRunning: true,
          processes: processesInfo
        };
    
        const ports = processes.flatMap(p => p.ports);
        if (ports.length > 0) {
          result.message += `\n利用可能なポート: ${ports.join(', ')}`;
        }
    
        if (processesInfo.some(p => p.hasRecentErrors)) {
          result.message += '\n⚠️ 一部のプロセスでエラーが発生しています。';
        }
    
        return JSON.stringify(result, null, 2);
    
      } catch (error) {
        logger.error('Failed to get dev server status', { error });
        return JSON.stringify({
          success: false,
          message: `ステータス取得に失敗しました: ${error}`,
          isRunning: false,
          processes: []
        });
      }
    }
  • The input/output schema definition for the get_dev_status tool, specifying no input parameters.
    export const getDevStatusSchema: Tool = {
      name: 'get_dev_status',
      description: 'npm run devプロセスの状態確認',
      inputSchema: {
        type: 'object',
        properties: {},
        additionalProperties: false
      }
    };
  • src/index.ts:55-65 (registration)
    Registration of the getDevStatusSchema in the tools array used for ListToolsRequestHandler.
    const tools = [
      scanProjectDirsSchema,
      startDevServerSchema,
      getDevStatusSchema,
      getDevLogsSchema,
      stopDevServerSchema,
      restartDevServerSchema,
      getHealthStatusSchema,
      recoverFromStateSchema,
      autoRecoverSchema,
    ];
  • src/index.ts:147-155 (registration)
    Tool dispatch/registration in the CallToolRequestHandler switch statement, invoking getDevStatus() when 'get_dev_status' is called.
    case 'get_dev_status':
      return {
        content: [
          {
            type: 'text',
            text: await getDevStatus(),
          },
        ],
      };
  • Dependency mapping for tools, specifying that get_dev_status requires the 'stateManager' service.
    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 checks status but doesn't describe what information is returned (e.g., running/stopped, PID, uptime), whether it's a read-only operation, or any side effects. For a status-checking tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase ('npm run devプロセスの状態確認') that directly states the purpose. It's appropriately sized for a simple tool with no parameters, though it could be slightly clearer in English for broader accessibility.

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 (0 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what 'status' entails, how the result is formatted, or how it differs from sibling tools. For a status-checking tool in a server with multiple monitoring options, more context is needed to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so a baseline of 4 is appropriate. No additional value is required or provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'npm run devプロセスの状態確認' states the purpose (checking the status of the npm run dev process) but is vague about what 'status' means. It doesn't distinguish from sibling tools like get_health_status or get_dev_logs, which might provide different types of status information. The Japanese text adds localization but doesn't improve specificity.

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?

No guidance is provided on when to use this tool versus alternatives like get_health_status or get_dev_logs. The description implies usage for checking dev process status but doesn't specify contexts, prerequisites, or exclusions. This leaves the agent to guess based on tool names alone.

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