getUserInfo
Retrieve current system user details from the operating environment to identify active users and their configurations.
Instructions
获取当前系统的用户信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:341-354 (handler)Handler function for getUserInfo tool: retrieves current user info using os.userInfo(), tmpdir, and homedir, then returns it as JSON text content.case "getUserInfo": { const userInfo = { userInfo: os.userInfo(), tmpdir: os.tmpdir(), homedir: os.homedir() }; return { content: [{ type: "text", text: JSON.stringify(userInfo, null, 2) }] }; }
- src/index.ts:64-72 (registration)Registration of the getUserInfo tool in the listTools response, including name, description, and empty input schema.{ name: "getUserInfo", description: "获取当前系统的用户信息", inputSchema: { type: "object", properties: {}, required: [] } },
- src/index.ts:67-71 (schema)Input schema for getUserInfo tool: empty object with no properties or requirements.inputSchema: { type: "object", properties: {}, required: [] }