getWifiInfo
Retrieve current device Wi-Fi connection details including network name, signal strength, and connection status to monitor network environment.
Instructions
获取当前设备的 Wi-Fi 信息
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": "getWifiInfo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:531-539 (handler)The handler implementation for the 'getWifiInfo' tool. It fetches Wi-Fi networks using the 'systeminformation' library (si.wifiNetworks()) and returns the information as a JSON string in the tool response format.
case "getWifiInfo": { const wifiInfo = await si.wifiNetworks(); return { content: [{ type: "text", text: JSON.stringify(wifiInfo, null, 2) }] }; } - src/index.ts:154-162 (schema)The schema/declaration of the 'getWifiInfo' tool in the list of available tools returned by the ListTools handler. Includes name, description, and input schema (empty object).
{ name: "getWifiInfo", description: "获取当前设备的 Wi-Fi 信息", inputSchema: { type: "object", properties: {}, required: [] } }, - src/index.ts:787-791 (registration)Registration of the request handlers for listing tools (which includes getWifiInfo schema) and calling tools (which dispatches to the getWifiInfo handler).
server.setRequestHandler(ListToolsRequestSchema, handleRequest); // 处理工具调用 server.setRequestHandler(CallToolRequestSchema, handleCallToolRequest);