Skip to main content
Glama
user.ts901 B
/** * User interface defining the structure of a user object */ interface User { id: string; name: string; email: string; createdAt: Date; } // No documentation - this should be flagged interface UserCreateInput { name: string; email: string; } /** * User model class */ class UserModel { private users: User[] = []; /** * Finds a user by ID * @param id - The user ID to search for * @returns The user object or undefined */ findById(id: string): User | undefined { return this.users.find(u => u.id === id); } // Missing parameter and return documentation create(input: UserCreateInput): User { const user: User = { id: Math.random().toString(36), ...input, createdAt: new Date() }; this.users.push(user); return user; } getAll(): User[] { return this.users; } } export { User, UserModel, UserCreateInput };

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/Njengah/claude-4.5-mcp-tutorial'

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