Skip to main content
Glama

mcp-google-sheets

data-source-dropdown.ts1.48 kB
import { Property } from '@activepieces/pieces-framework'; import { HttpMethod } from '@activepieces/pieces-common'; import { CognosClient } from './cognos-client'; export const dataSourceDropdown = Property.Dropdown({ displayName: 'Data Source', description: 'Select a data source', required: true, refreshers: [], options: async ({ auth }) => { if (!auth) { return { disabled: true, options: [], placeholder: 'Connect your account first' }; } try { const client = new CognosClient(auth as any); const response = await client.makeAuthenticatedRequest('/dataSources', HttpMethod.GET); if (response.status === 200) { const data = response.body; const dataSources = data.dataSources || []; if (dataSources.length === 0) { return { disabled: true, options: [], placeholder: 'No data sources found' }; } return { disabled: false, options: dataSources.map((ds: any) => ({ label: ds.defaultName || ds.id, value: ds.id })) }; } else { return { disabled: true, options: [], placeholder: 'Failed to load data sources' }; } } catch (error) { return { disabled: true, options: [], placeholder: 'Error loading data sources' }; } } });

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