Skip to main content
Glama

Carbon Voice

by PhononX
get-user-id-from-token.ts456 B
import jwt from 'jsonwebtoken'; import { TokenIntrospectionResponse } from '../auth/interfaces/auth.types'; /** * Try to get the user ID from the token (Only possible with bearer token) * @param token - The token to get the user ID from * @returns The user ID */ export const getUserIdFromToken = (token?: string) => { if (!token) { return null; } const decoded = jwt.decode(token) as TokenIntrospectionResponse; return decoded.sub; };

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/PhononX/cv-mcp-server'

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