Skip to main content
Glama
retrieve-page.js1.98 kB
export const retrievePageToolDefinition = { name: 'notion_retrieve_page', description: 'Retrieves a Notion page by ID. Returns page properties, not page content.', inputSchema: { type: 'object', properties: { page_id: { type: 'string', description: 'The ID of the page to retrieve' }, filter_properties: { type: 'array', items: { type: 'string' }, description: 'Optional list of property IDs to filter the response' } }, required: ['page_id'] } }; export async function handleRetrievePageTool(client, args) { try { const retrieveArgs = { page_id: args.page_id, ...(args.filter_properties && { filter_properties: args.filter_properties }) }; const response = await client.retrievePage(retrieveArgs); return { content: [ { type: 'text', text: `Retrieved page: ${response.id}\n` + `URL: ${'url' in response ? response.url : 'N/A'}\n` + `Created: ${'created_time' in response ? response.created_time : 'N/A'}\n` + `Last edited: ${'last_edited_time' in response ? response.last_edited_time : 'N/A'}\n` + `Properties: ${'properties' in response ? JSON.stringify(response.properties, null, 2) : 'N/A'}` } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving page: ${error.message || 'Unknown error'}` } ], isError: true }; } } export const retrievePageTool = { definition: retrievePageToolDefinition, handler: handleRetrievePageTool };

Latest Blog Posts

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/michaelwaves/notion-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server