Skip to main content
Glama

mcp-google-sheets

create-notebook.ts1.64 kB
import { Property, createAction, OAuth2PropertyValue } from '@activepieces/pieces-framework'; import { oneNoteAuth } from '../../index'; import { Client } from '@microsoft/microsoft-graph-client'; export const createNotebook = createAction({ auth: oneNoteAuth, name: 'create_notebook', displayName: 'Create Notebook', description: 'Creates a notebook.', props: { displayName: Property.ShortText({ displayName: 'Notebook Name', description: 'The name of the notebook. Must be unique and cannot contain more than 128 characters or the following characters: ?*/:<>|\'"%~', required: true, }), }, async run(context) { const { auth, propsValue } = context; const { displayName } = propsValue; const client = Client.initWithMiddleware({ authProvider: { getAccessToken: () => Promise.resolve((auth as OAuth2PropertyValue).access_token), }, }); const notebookBody = { displayName, }; try { const response = await client.api('/me/onenote/notebooks').post(notebookBody); return { id: response.id, displayName: response.displayName, userRole: response.userRole, isShared: response.isShared, isDefault: response.isDefault, createdDateTime: response.createdDateTime, lastModifiedDateTime: response.lastModifiedDateTime, createdBy: response.createdBy, lastModifiedBy: response.lastModifiedBy, sectionsUrl: response.sectionsUrl, sectionGroupsUrl: response.sectionGroupsUrl, links: response.links, self: response.self, }; } catch (error: any) { throw new Error(`Failed to create notebook: ${error.message || 'Unknown error'}`); } }, });

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