Skip to main content
Glama

mcp-google-sheets

group-dropdown.ts1.53 kB
import { Property } from '@activepieces/pieces-framework'; import { httpClient, HttpMethod } from '@activepieces/pieces-common'; import { getAuthToken, CyberArkAuth } from './auth-helper'; export const groupIdDropdown = Property.Dropdown({ displayName: 'Group', description: 'Select a group from the Vault', required: true, refreshers: [], options: async ({ auth }) => { if (!auth) { return { disabled: true, placeholder: 'Please authenticate first', options: [], }; } try { const authData = await getAuthToken(auth as CyberArkAuth); const response = await httpClient.sendRequest({ method: HttpMethod.GET, url: `${authData.serverUrl}/PasswordVault/API/UserGroups`, headers: { 'Content-Type': 'application/json', 'Authorization': authData.token, }, }); if (response.status === 200 && response.body?.value) { const groups = response.body.value; return { disabled: false, options: groups.map((group: any) => ({ label: `${group.groupName} (ID: ${group.id}) - ${group.groupType}`, value: group.id.toString(), })), }; } else { return { disabled: true, placeholder: 'Failed to load groups', options: [], }; } } catch (error) { return { disabled: true, placeholder: 'Error loading groups', options: [], }; } }, });

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