Skip to main content
Glama
huseyindol

User Info MCP Server

by huseyindol

search_users_by_phone

Locate user details stored in the User Info MCP Server by entering a phone number, enabling quick retrieval of associated information for efficient user management.

Instructions

Telefon numarasına göre kullanıcı ara

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phoneYesAranacak Telefon numarası

Implementation Reference

  • The tool handler function that processes the phone input, calls the user service, handles errors, and returns the formatted MCP ToolResponse with user data or error message.
    static async handleSearchUsersByPhone({ phone }: { phone: string }): Promise<ToolResponse> { try { const result = await userService.searchUsersByPhone(phone); return { content: [ { type: "text", text: result.success && result.data ? JSON.stringify(result.data, null, 2) : result.message || result.error || "Kullanıcı bulunamadı", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Kullanıcı arama işleminde hata oluştu", }, ], }; } }
  • MCP server registration of the 'search_users_by_phone' tool, including name, title, description, input schema reference, and handler binding.
    server.registerTool( "search_users_by_phone", { title: "Kullanıcı Ara", description: "Telefon numarasına göre kullanıcı ara", inputSchema: SearchUsersByPhoneInputSchema, }, UserController.handleSearchUsersByPhone );
  • Zod input schema defining the 'phone' parameter validation for the tool input.
    export const SearchUsersByPhoneInputSchema = { phone: z.string().min(10).max(20).describe("Aranacak Telefon numarası") };
  • Service layer method providing business logic validation for phone format and delegating to repository for user lookup by phone.
    async searchUsersByPhone(phone: string): Promise<ServiceResult<User | null>> { try { // Business rule: Phone must be a valid phone number if (!phone.includes(' ')) { return { success: false, error: "Telefon numarası geçersiz", data: null }; } const user = await userRepository.findByPhone(phone); return { success: true, data: user, message: user ? `"${phone}" için kullanıcı bulundu` : `"${phone}" telefon numarasıyla kullanıcı bulunamadı` }; } catch (error) { return { success: false, error: "Kullanıcı arama işleminde hata oluştu", data: null }; } }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huseyindol/McpProjectScaffold'

If you have feedback or need assistance with the MCP directory API, please join our Discord server