notion_retrieve_page_property
Retrieve a specific property from a Notion page, especially for properties with over 25 references. Supports pagination to manage large data sets efficiently.
Instructions
Retrieves a specific property of a Notion page. Use for properties with more than 25 references.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | The ID of the page | |
| page_size | No | Number of items to return (max 100) | |
| property_id | Yes | The ID of the property to retrieve | |
| start_cursor | No | Cursor for pagination |
Implementation Reference
- The handler function that implements the core logic of the 'notion_retrieve_page_property' tool by calling NotionClient.retrievePageProperty and formatting the response or error.export async function handleRetrievePagePropertyTool(client: NotionClient, args: any) { try { const propertyArgs: RetrievePagePropertyArgs = { page_id: args.page_id, property_id: args.property_id, ...(args.page_size && { page_size: args.page_size }), ...(args.start_cursor && { start_cursor: args.start_cursor }) }; const response = await client.retrievePageProperty(propertyArgs); return { content: [ { type: 'text', text: `Retrieved property: ${args.property_id}\n` + `Type: ${response.type}\n` + `Has more: ${'has_more' in response ? response.has_more : false}\n` + `Next cursor: ${'next_cursor' in response ? response.next_cursor || 'N/A' : 'N/A'}\n` + `Data: ${JSON.stringify(response, null, 2)}` } ] }; } catch (error: any) { return { content: [ { type: 'text', text: `Error retrieving page property: ${error.message || 'Unknown error'}` } ], isError: true }; } }
- The tool definition object containing the name, description, and input schema (JSON Schema) for validating tool inputs.export const retrievePagePropertyToolDefinition: Tool = { name: 'notion_retrieve_page_property', description: 'Retrieves a specific property of a Notion page. Use for properties with more than 25 references.', inputSchema: { type: 'object', properties: { page_id: { type: 'string', description: 'The ID of the page' }, property_id: { type: 'string', description: 'The ID of the property to retrieve' }, page_size: { type: 'number', description: 'Number of items to return (max 100)', minimum: 1, maximum: 100 }, start_cursor: { type: 'string', description: 'Cursor for pagination' } }, required: ['page_id', 'property_id'] } };
- src/server.ts:43-50 (registration)Registration of the tool definition in the MCP server's ListTools handler, making it discoverable.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ createPageToolDefinition, retrievePageToolDefinition, updatePageToolDefinition, retrievePagePropertyToolDefinition ], }));
- src/server.ts:65-66 (registration)Dispatch/registration of the tool handler in the MCP server's CallTool switch statement for execution.case 'notion_retrieve_page_property': return handleRetrievePagePropertyTool(this.client, args);
- src/server.ts:128-129 (registration)Similar dispatch in the standalone server creator's CallTool handler.case 'notion_retrieve_page_property': return handleRetrievePagePropertyTool(client, args);