get_all_users
Retrieve a complete list of users from the User Info MCP Server for management or analysis purposes using the designated tool.
Instructions
Tüm kullanıcıların listesini getir
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/controllers/user.controller.ts:24-48 (handler)The main tool handler function that fetches all users via the userService and formats the response as MCP ToolResponse.static async handleGetAllUsers(): Promise<ToolResponse> { try { const result = await userService.getAllUsers(); return { content: [ { type: "text", text: result.success ? JSON.stringify(result.data, null, 2) : result.error || "Bilinmeyen hata", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Tool handler'da beklenmeyen hata oluştu", }, ], }; } }
- src/tools/user-tools.ts:19-27 (registration)Registers the get_all_users tool on the MCP server, specifying title, description, empty input schema, and the handler function.server.registerTool( "get_all_users", { title: "Tüm Kullanıcıları Getir", description: "Tüm kullanıcıların listesini getir", inputSchema: {}, }, UserController.handleGetAllUsers );
- src/services/user.service.ts:24-39 (helper)Helper service method invoked by the handler to retrieve all users from the repository with error handling.async getAllUsers(): Promise<ServiceResult<User[]>> { try { const users = await userRepository.findAll(); return { success: true, data: users, message: `${users.length} kullanıcı bulundu` }; } catch (error) { return { success: false, error: "Kullanıcılar yüklenirken hata oluştu", data: [] }; } }
- src/tools/user-tools.ts:24-24 (schema)Empty input schema for the get_all_users tool (no input parameters required).inputSchema: {},