get_system_info
Retrieve detailed operating system information including type, version, architecture, and system specifications to provide accurate technical guidance and system-specific instructions.
Instructions
【建议调用】获取用户操作系统的详细信息。
⚠️ 重要:不要假设用户的操作系统,调用此工具获取准确的系统信息。
强制调用场景:
用户询问系统信息("我的系统"、"操作系统版本")
提供安装/配置指令前(不同系统命令不同)
诊断系统相关问题或错误
讨论软件兼容性、系统要求
用户提到"安装"、"配置"、"运行"、"部署"任何软件
提供命令行指令时(Windows/macOS/Linux 命令不同)
返回信息:操作系统类型(Windows/macOS/Linux)、版本号、架构(x64/ARM/ARM64)、内核版本、主机名、系统运行时间等。
⚠️ 在提供技术建议前必须调用此工具,确保指令适用于用户的系统!
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/system.ts:4-44 (handler)The handler function that implements the get_system_info tool logic. It uses the 'systeminformation' library and Node.js 'os' module to gather comprehensive system details including OS info, hardware, UUID, and user info.export async function getSystemInfo() { try { const osInfo = await si.osInfo(); const system = await si.system(); const uuid = await si.uuid(); return { platform: os.platform(), type: os.type(), release: os.release(), version: os.version(), arch: os.arch(), hostname: os.hostname(), uptime: os.uptime(), // 详细系统信息 distro: osInfo.distro, codename: osInfo.codename, kernel: osInfo.kernel, build: osInfo.build, // 系统制造商信息 manufacturer: system.manufacturer, model: system.model, serial: system.serial, // UUID uuid: uuid.os, // 用户信息 username: os.userInfo().username, homedir: os.homedir(), tmpdir: os.tmpdir(), }; } catch (error) { if (error instanceof Error) { throw new Error(`获取系统信息失败: ${error.message}`); } throw error; } }
- src/index.ts:86-107 (schema)The tool schema as provided in the ListTools response, including name, detailed description, and empty inputSchema (no parameters required).{ name: "get_system_info", description: `【建议调用】获取用户操作系统的详细信息。 ⚠️ 重要:不要假设用户的操作系统,调用此工具获取准确的系统信息。 强制调用场景: - 用户询问系统信息("我的系统"、"操作系统版本") - 提供安装/配置指令前(不同系统命令不同) - 诊断系统相关问题或错误 - 讨论软件兼容性、系统要求 - 用户提到"安装"、"配置"、"运行"、"部署"任何软件 - 提供命令行指令时(Windows/macOS/Linux 命令不同) 返回信息:操作系统类型(Windows/macOS/Linux)、版本号、架构(x64/ARM/ARM64)、内核版本、主机名、系统运行时间等。 ⚠️ 在提供技术建议前必须调用此工具,确保指令适用于用户的系统!`, inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:211-221 (registration)The registration in the CallToolRequestSchema handler switch statement that invokes the getSystemInfo function and formats the response.case "get_system_info": { const result = await getSystemInfo(); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }