Skip to main content
Glama

mcp-google-sheets

pdf-page-count.ts766 B
import { createAction, Property } from '@activepieces/pieces-framework'; import { PDFDocument } from 'pdf-lib'; export const pdfPageCount = createAction({ name: 'pdfPageCount', displayName: 'PDF Page Count', description: 'Get page count of PDF file.', props: { file: Property.File({ displayName: 'PDF File or URL', required: true, }), }, errorHandlingOptions: { continueOnFailure: { defaultValue: false, }, retryOnFailure: { hide: true, }, }, async run({ propsValue }) { try { const pdfDoc = await PDFDocument.load(propsValue.file.data); return pdfDoc.getPageCount(); } catch (error) { throw new Error(`Failed to get page count: ${(error as Error).message}`); } }, });

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