Skip to main content
Glama

mcp-google-sheets

find-customer.ts1.25 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 findCustomer = createAction({ auth: helpScoutAuth, name: 'find_customer', displayName: 'Find Customer', description: 'Finds a customer 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 email.'), }); const response = await helpScoutApiRequest({ method: HttpMethod.GET, url: `/customers`, auth, queryParams: { query: `(email:"${propsValue.email}")`, }, }); const { _embedded } = response.body as { _embedded: { customers: { id: number; firstName: string; lastName: string }[]; }; }; return { found: _embedded.customers.length > 0, data: _embedded.customers.length > 0 ? _embedded.customers[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