Skip to main content
Glama
huseyindol

User Info MCP Server

by huseyindol

Kullanıcı Ara

search_users_by_name

Find users by name in the User Info MCP Server to retrieve and manage user data stored in JSON files.

Instructions

İsme göre kullanıcı ara

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesAranacak kullanıcı ismi

Implementation Reference

  • The main handler function for the 'search_users_by_name' tool. It receives the input, calls the user service to perform the search, handles errors, and returns a formatted MCP ToolResponse.
    static async handleSearchUsersByName({ name }: { name: string }): Promise<ToolResponse> {
      try {
        const result = await userService.searchUsersByName(name);
        
        return {
          content: [
            {
              type: "text",
              text: result.success && result.data && result.data.length > 0
                ? 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-based input schema defining the expected 'name' parameter for the tool.
    export const SearchUsersByNameInputSchema = {
      name: z.string().min(1).describe("Aranacak kullanıcı ismi")
    };
  • Tool registration using server.registerTool, specifying name, metadata, input schema, and handler reference.
    server.registerTool(
      "search_users_by_name",
      {
        title: "Kullanıcı Ara",
        description: "İsme göre kullanıcı ara",
        inputSchema: SearchUsersByNameInputSchema,
      },
      UserController.handleSearchUsersByName
    );
  • Business logic helper in the service layer that validates input, queries the repository, and returns structured results used by the handler.
    async searchUsersByName(name: string): Promise<ServiceResult<User[]>> {
      try {
        // Business rule: Name must be at least 2 characters
        if (name.trim().length < 2) {
          return {
            success: false,
            error: "Arama terimi en az 2 karakter olmalıdır",
            data: []
          };
        }
    
        const users = await userRepository.findByName(name);
        
        return {
          success: true,
          data: users,
          message: users.length > 0 
            ? `"${name}" için ${users.length} kullanıcı bulundu`
            : `"${name}" ismiyle kullanıcı bulunamadı`
        };
      } catch (error) {
        return {
          success: false,
          error: "Kullanıcı arama işleminde hata oluştu",
          data: []
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the basic action (search by name) without disclosing behavioral traits like whether it's read-only, what permissions are needed, how results are returned (list, single user), pagination, error handling, or performance characteristics. This is inadequate for a search tool with zero annotation coverage.

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. It's appropriately sized and front-loaded with no wasted words, making it easy to parse quickly.

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 no annotations, no output schema, and multiple sibling tools, the description is incomplete. It doesn't explain what the tool returns, how to interpret results, or differentiate it from similar search tools. For a search operation in a user management context, more guidance is needed to help the agent use it correctly.

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?

Schema description coverage is 100%, with the single parameter 'name' documented as 'Aranacak kullanıcı ismi' (User name to search). The description adds no additional meaning beyond what the schema provides, such as format examples or search semantics. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose3/5

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

The description 'İsme göre kullanıcı ara' (Search users by name) states a clear verb ('ara' - search) and resource ('kullanıcı' - users), but it's vague about scope and doesn't distinguish from sibling tools like search_users_by_email or search_users_by_phone. It only specifies the search criteria (by name) without indicating what kind of search (exact match, partial, etc.) or what results to expect.

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 like search_users_by_email, get_user_by_id, or get_all_users. There's no mention of prerequisites, limitations, or typical use cases. The agent 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