Skip to main content
Glama

mcp-google-sheets

read-document.action.ts994 B
import { googleDocsAuth } from '../../index'; import { Property, createAction } from '@activepieces/pieces-framework'; import { google } from 'googleapis'; import { OAuth2Client } from 'googleapis-common'; export const readDocument = createAction({ displayName: 'Read Document', auth: googleDocsAuth, name: 'read_document', description: 'Read a document from Google Docs', props: { documentId: Property.ShortText({ displayName: 'Document ID', description: 'The ID of the document to read', required: true, }), }, async run(context) { const authClient = new OAuth2Client(); authClient.setCredentials(context.auth); const docs = google.docs({ version: 'v1', auth: authClient }); const response = await docs.documents.get({ documentId: context.propsValue.documentId, }); if (response.status !== 200) { console.error(response); throw new Error('Error reading document'); } return response.data; }, });

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