Skip to main content
Glama

mcp-google-sheets

companies.ts2.23 kB
import { PiecePropValueSchema, Property, createAction, } from '@activepieces/pieces-framework'; import { limitField, makeClient, pageField } from '../common'; import { PredictLeadsAuth } from '../../index'; import { prepareQuery } from '../common/client'; export const findCompaniesAction = createAction({ auth: PredictLeadsAuth, name: 'predict-leads_find_companies', displayName: 'List Companies', description: 'Retrieves all companies.', props: { location: Property.ShortText({ displayName: 'Location', required: true, }), minMaxSizes: Property.ShortText({ displayName: 'Min Max Size', description: 'A min-max size range. Examples: "11-50"". For now, only single range is supported.', required: true, }), page: pageField, limit: limitField, }, async run(context) { const page = context.propsValue.page ?? 1; const limit = context.propsValue.limit ?? 1000; const location = context.propsValue.location; const min_max_sizes = context.propsValue.minMaxSizes; const client = makeClient( context.auth as PiecePropValueSchema<typeof PredictLeadsAuth> ); try { const response = await client.findCompanies( prepareQuery({ location, min_max_sizes, page, limit, }) ); return response; } catch (error) { throw new Error(JSON.stringify(error, undefined, 2)); } }, }); export const findCompanyByDomainAction = createAction({ auth: PredictLeadsAuth, name: 'predict-leads_find_company_by_domain', displayName: 'Retrieve a company', description: 'Retrieves a company by its domain.', props: { domain: Property.ShortText({ displayName: 'Domain', description: 'The domain of the company to find.', required: true, }), }, async run(context) { const domain = context.propsValue.domain; const client = makeClient( context.auth as PiecePropValueSchema<typeof PredictLeadsAuth> ); try { const response = await client.findCompanyByDomain(domain); return response; } catch (error) { throw new Error(JSON.stringify(error, undefined, 2)); } }, });

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