Skip to main content
Glama

mcp-google-sheets

users-controller.ts1.7 kB
import { assertNotNullOrUndefined, PrincipalType, UserWithMetaInformationAndProject } from '@activepieces/shared' import { FastifyPluginAsyncTypebox } from '@fastify/type-provider-typebox' import { StatusCodes } from 'http-status-codes' import { userIdentityService } from '../../authentication/user-identity/user-identity-service' import { userService } from '../../user/user-service' export const usersController: FastifyPluginAsyncTypebox = async (app) => { app.get('/me', GetCurrentUserRequest, async (req): Promise<UserWithMetaInformationAndProject> => { const userId = req.principal.id assertNotNullOrUndefined(userId, 'userId') const user = await userService.getOneOrFail({ id: userId }) const identity = await userIdentityService(app.log).getOneOrFail({ id: user.identityId }) return { id: user.id, platformRole: user.platformRole, status: user.status, externalId: user.externalId, lastChangelogDismissed: user.lastChangelogDismissed, created: user.created, updated: user.updated, platformId: user.platformId, firstName: identity.firstName, lastName: identity.lastName, email: identity.email, trackEvents: identity.trackEvents, newsLetter: identity.newsLetter, verified: identity.verified, projectId: req.principal.projectId, } }) } const GetCurrentUserRequest = { schema: { response: { [StatusCodes.OK]: UserWithMetaInformationAndProject, }, }, config: { allowedPrincipals: [PrincipalType.USER], }, }

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/activepieces/activepieces'

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