Skip to main content
Glama
huseyindol

User Info MCP Server

by huseyindol

Kullanıcı Ara

search_users_by_phone

Find user information by entering a phone number to search through stored user data.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
phoneYesAranacak Telefon numarası

Implementation Reference

  • The main tool handler function for 'search_users_by_phone'. It receives the phone parameter, calls the user service to perform the search, formats the result as an MCP ToolResponse, and handles errors.
    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",
            },
          ],
        };
      }
    }
  • Zod input schema defining the 'phone' parameter for the tool, with length validation and description.
    export const SearchUsersByPhoneInputSchema = {
      phone: z.string().min(10).max(20).describe("Aranacak Telefon numarası")
    };
  • Tool registration call on the MCP server, specifying the tool name, metadata (title, description), input schema, and handler reference.
    server.registerTool(
      "search_users_by_phone",
      {
        title: "Kullanıcı Ara",
        description: "Telefon numarasına göre kullanıcı ara",
        inputSchema: SearchUsersByPhoneInputSchema,
      },
      UserController.handleSearchUsersByPhone
    );
  • Service layer method implementing the search logic by phone, including business validation (phone format check) and repository call.
    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
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the search action without mentioning what the search returns (e.g., partial matches, exact matches, error handling), whether it's read-only or has side effects, or any rate limits or permissions required. For a search tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Turkish that directly states the tool's purpose without any fluff. It's appropriately sized and front-loaded, with every word contributing to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the search returns (e.g., user objects, IDs, or error messages), how results are structured, or any limitations. For a search tool with no structured output documentation, the description should provide more context about the expected behavior and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description implies a 'phone' parameter but doesn't add meaning beyond what the input schema provides. The schema has 100% description coverage with a clear parameter description ('Aranacak Telefon numarası'), so the baseline is 3. The tool description doesn't elaborate on format expectations or search behavior beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Telefon numarasına göre kullanıcı ara' clearly states the tool's purpose: searching for users by phone number. It specifies both the verb ('ara' - search) and the resource ('kullanıcı' - users), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'search_users_by_email' or 'search_users_by_name', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'search_users_by_email' or 'search_users_by_name' for different search criteria, nor does it indicate any prerequisites or exclusions. The user must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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