Skip to main content
Glama

search_users

Find users by name, email, department, or position within the MCP JSON Database Server using a search query. Simplify user management and retrieval with targeted search functionality.

Instructions

Kullanıcıları ad, email, departman veya pozisyona göre arar

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesArama terimi

Implementation Reference

  • The handler for the 'search_users' tool. Extracts query from arguments, calls the searchUsers helper function on the database users, removes passwords from results for security, and returns the filtered users as JSON text.
    case 'search_users': { const { query } = args; const results = searchUsers(db.users, query); const resultsWithoutPasswords = results.map(user => { const { password, ...userWithoutPassword } = user; return userWithoutPassword; }); return { content: [{ type: 'text', text: JSON.stringify(resultsWithoutPasswords, null, 2) }] }; }
  • src/index.js:244-254 (registration)
    Registration of the 'search_users' tool in the MCP server's tool list, including name, description, and input schema requiring a 'query' string.
    { name: 'search_users', description: 'Kullanıcıları ad, email, departman veya pozisyona göre arar', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Arama terimi' } }, required: ['query'] } },
  • Helper function implementing the core search logic: case-insensitive filtering of users array by name, email, department, or position matching the query.
    export function searchUsers(users, query) { const searchTerm = query.toLowerCase(); return users.filter(user => user.name.toLowerCase().includes(searchTerm) || user.email.toLowerCase().includes(searchTerm) || user.department.toLowerCase().includes(searchTerm) || user.position.toLowerCase().includes(searchTerm) ); }

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/yusuferenkt/mcp-database'

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