MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getUserInfo

Function getUserInfo

server/src/routes/content.ts:327–339  ·  view source on GitHub ↗

* Get user info for author display

(userId: string)

Source from the content-addressed store, hash-verified

325 * Get user info for author display
326 */
327async function getUserInfo(userId: string): Promise<{ name: string } | null> {
328 const pool = getPool();
329 const result = await pool.query(
330 `SELECT first_name, last_name, email FROM users WHERE workos_user_id = $1`,
331 [userId]
332 );
333 if (result.rows.length === 0) return null;
334 const user = result.rows[0];
335 const name = user.first_name && user.last_name
336 ? `${user.first_name} ${user.last_name}`
337 : user.email?.split('@')[0] || 'Unknown';
338 return { name };
339}
340
341/**
342 * User context for direct function calls (from Addie or other internal services)

Callers 1

proposeContentForUserFunction · 0.85

Calls 2

getPoolFunction · 0.85
queryMethod · 0.80

Tested by

no test coverage detected