Skip to main content
Glama

mcp-google-sheets

find-user.ts1.17 kB
import { createAction, Property } from '@activepieces/pieces-framework'; import { helpScoutApiRequest } from '../common/api'; import { helpScoutAuth } from '../common/auth'; import { propsValidation } from '@activepieces/pieces-common'; import { z } from 'zod'; import { HttpMethod } from '@activepieces/pieces-common'; export const findUser = createAction({ auth: helpScoutAuth, name: 'find_user', displayName: 'Find User', description: 'Finds a user by email.', props: { email: Property.ShortText({ displayName: 'Email', required: true, }), }, async run({ auth, propsValue }) { await propsValidation.validateZod(propsValue, { email: z.string().min(1, 'Please provide a valid email.'), }); const response = await helpScoutApiRequest({ method: HttpMethod.GET, url: `/users?email=${propsValue.email}`, auth, }); const { _embedded } = response.body as { _embedded: { users: { id: number; firstName: string; lastName: string }[]; }; }; return { found: _embedded.users.length > 0, data: _embedded.users.length > 0 ? _embedded.users[0] : {}, }; }, });

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