getUsbInfo
Retrieve USB device information from the current operating environment to identify connected hardware and troubleshoot connectivity issues.
Instructions
获取当前设备的 USB 设备信息
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "getUsbInfo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:678-686 (handler)Handler implementation for the getUsbInfo tool. It calls si.usb() from the systeminformation library to fetch USB information and returns it as a JSON string in the tool response format.
case "getUsbInfo": { const usbInfo = await si.usb(); return { content: [{ type: "text", text: JSON.stringify(usbInfo, null, 2) }] }; } - src/index.ts:235-243 (registration)Registration of the getUsbInfo tool in the tools list returned by handleRequest, including name, description, and empty input schema.
{ name: "getUsbInfo", description: "获取当前设备的 USB 设备信息", inputSchema: { type: "object", properties: {}, required: [] } }, - src/index.ts:238-242 (schema)Input schema for getUsbInfo tool, which is an empty object (no parameters required).
inputSchema: { type: "object", properties: {}, required: [] } - src/index.ts:9-9 (helper)Import of the systeminformation library (si), used by getUsbInfo and other tools to fetch USB info.
import si from 'systeminformation'; // 导入 systeminformation 库