check_tools
Verifies that Node.js, GenLayer, Python, and genvm-lint are installed and accessible.
Instructions
Check whether node, genlayer, python, and genvm-lint are available to this MCP server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:505-523 (handler)The 'check_tools' tool registration and handler. Calls checkCommand for 'node', 'genlayer', 'python', and 'genvm-lint', then returns a response with cwd, privateKeyConfig status, and the checks results.
server.tool( "check_tools", "Check whether node, genlayer, python, and genvm-lint are available to this MCP server.", {}, async () => { const checks = await Promise.all([ checkCommand("node"), checkCommand("genlayer"), checkCommand("python"), checkCommand("genvm-lint") ]); return textResponse({ cwd: processCwd(), privateKeyConfig: getPrivateKeyConfigStatus(), checks }); } ); - src/index.ts:458-477 (helper)The checkCommand helper function. Runs a command with --version (by default) and returns an object with resolvedCommand, available (boolean), version, error, and exitCode.
async function checkCommand(command: string, args: string[] = ["--version"]) { const result = await runCommand(command, { args, timeoutMs: 15_000 }); const error = result.error || result.stderr.trim() || result.stdout.trim() || (result.exitCode === null ? "Command could not be started" : `Command failed with exit code ${result.exitCode}`); return { command, resolvedCommand: result.resolvedCommand, available: result.exitCode === 0, version: result.exitCode === 0 ? result.stdout.trim() || result.stderr.trim() : null, error: result.exitCode === 0 ? undefined : error, exitCode: result.exitCode }; } - src/index.ts:396-409 (helper)Helper function getPrivateKeyConfigStatus used in the check_tools handler to report private key configuration status.
function getPrivateKeyConfigStatus() { const configuredPrivateKey = getConfiguredPrivateKey(); const normalizedPrivateKey = normalizePrivateKey(configuredPrivateKey.value); return { source: configuredPrivateKey.source, configured: Boolean(configuredPrivateKey.value), valid: Boolean(normalizedPrivateKey), willGenerateOnDeploy: !normalizedPrivateKey, note: normalizedPrivateKey ? "genlayer_deploy will use the configured private key." : "genlayer_deploy will generate a new private key and deploy with it." }; } - src/index.ts:85-94 (helper)Helper function textResponse that wraps output in the MCP text content format, used by check_tools handler.
function textResponse(value: unknown) { return { content: [ { type: "text" as const, text: stringifyJson(value) } ] }; } - src/index.ts:505-523 (registration)Registration of the 'check_tools' tool on the MCP server via server.tool(). The schema is an empty object {} (no input parameters).
server.tool( "check_tools", "Check whether node, genlayer, python, and genvm-lint are available to this MCP server.", {}, async () => { const checks = await Promise.all([ checkCommand("node"), checkCommand("genlayer"), checkCommand("python"), checkCommand("genvm-lint") ]); return textResponse({ cwd: processCwd(), privateKeyConfig: getPrivateKeyConfigStatus(), checks }); } );