Tüm Kullanıcıları Getir
get_all_usersRetrieve a complete list of all users from the User Info MCP Server to access stored user data for management and analysis.
Instructions
Tüm kullanıcıların listesini getir
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": "get_all_users"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/controllers/user.controller.ts:24-48 (handler)The MCP tool handler function that fetches all users from the service layer and returns a formatted 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 with the MCP server, specifying title, description, empty input schema, and linking to 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)Service layer method that retrieves all users from the repository and handles errors, returning a standardized ServiceResult.
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: [] }; } }