API-get-background-result
Fetch the result of a background-processed Notion page using its page ID. Designed for the Notion ReadOnly MCP Server to enable efficient retrieval of processed data.
Instructions
Retrieve the result of a background processing request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | Yes | Identifier for the Notion page that was processed in background |
Implementation Reference
- src/openapi-mcp-server/mcp/proxy.ts:180-196 (registration)Registers the 'API-get-background-result' tool in the list tools handler, defining its input schema.const backgroundResultTool = { name: 'API-get-background-result', description: 'Retrieve the result of a background processing request', inputSchema: { type: 'object', properties: { page_id: { type: 'string', description: 'Identifier for the Notion page that was processed in background', }, }, required: ['page_id'], } as Tool['inputSchema'], }; tools.push(backgroundResultTool); console.log(`- ${backgroundResultTool.name}: ${backgroundResultTool.description}`);
- Executes the tool logic by retrieving the background result using getBackgroundProcessingResult and returning it as JSON text content.// Handle background result retrieval if (name === 'API-get-background-result') { const result = this.getBackgroundProcessingResult(params?.page_id as string); return { content: [ { type: 'text', text: JSON.stringify(result), }, ], }; }
- Helper method that fetches the stored background processing result for the given page ID from the internal Map, or returns a not_found message.public getBackgroundProcessingResult(pageId: string): any { return this.backgroundProcessingResults.get(pageId) || { status: 'not_found', message: `No background processing result found for page ${pageId}` }; }
- Helper method that stores the background processing result in the internal Map for later retrieval.private storeBackgroundProcessingResult(pageId: string, result: any): void { this.backgroundProcessingResults.set(pageId, result); }