Skip to main content
Glama

listar-usuarios

Retrieve all registered users from the system for user management and administration tasks.

Instructions

Lista todos los usuarios registrados en el sistema

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'listar-usuarios' tool, which fetches users using getUsers and formats them into a text response.
    export async function listUsersToolHandler() { // Obtener la lista de usuarios const users = await getUsers(); // Formateamos la lista de usuarios para mostrarla let usersList = users.map(user => `- ID: ${user.id}\n Nombre: ${user.nombre} ${user.apellido}\n DNI: ${user.dni}\n Creado: ${user.createdAt.toLocaleString()}` ).join('\n\n'); // Si no hay usuarios, mostrar un mensaje adecuado if (users.length === 0) { usersList = "No hay usuarios registrados en el sistema."; } else { usersList = `Se encontraron ${users.length} usuario(s):\n\n${usersList}`; } // Devolvemos el resultado formateado para MCP return { content: [ { type: "text" as const, text: usersList } ] }; }
  • Input schema for the 'listar-usuarios' tool, which requires no parameters.
    export const listUsersInputSchema = {};
  • src/main.ts:43-50 (registration)
    Registration of the 'listar-usuarios' tool in the MCP server, linking the name, description, input schema, and handler.
    server.registerTool( "listar-usuarios", { description: "Lista todos los usuarios registrados en el sistema", inputSchema: listUsersInputSchema }, listUsersToolHandler );
  • Helper function that retrieves all users from the in-memory database, called by the tool handler.
    export async function getUsers(): Promise<User[]> { return [...users]; }

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/mcgiverdev/mcp-api-v1'

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