getUserInfo
Retrieve current system user details from the operating environment to identify active users and their configurations.
Instructions
获取当前系统的用户信息
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": "getUserInfo"
}
}Input 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: [] }