Skip to main content
Glama

mcp-google-sheets

read-file.ts1.39 kB
import { zohoCrmAuth } from '../../index'; import { Property, createAction } from "@activepieces/pieces-framework"; export const readFile = createAction({ auth: zohoCrmAuth, name: 'read-file', displayName: 'Read file', description: 'Download a file content from Zoho CRM. e.g.: a Backup File', props: { url: Property.ShortText({ displayName: 'URL', description: 'The full URL to use, including the base URL', required: true, defaultValue: '', }) }, run: async ({ auth, propsValue, files }) => { const url = propsValue['url']; const download = await fetch(url, { headers: { Authorization: `Bearer ${auth.access_token}`, }, }) .then((response) => response.ok ? response.blob() : Promise.reject(response) ) .catch((error) => Promise.reject( new Error( `Error when download file:\n\tDownload file response: ${(error as Error).message ?? error }` ) ) ); const fileName = url.split('/').pop() ?? url; return files.write({ fileName: fileName, data: Buffer.from(await download.arrayBuffer()), }); }, });

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