Skip to main content
Glama

get_page

Retrieve complete page details and content from Productive.io by providing a page identifier. This tool accesses specific documents with full JSON-formatted information for read-only data access.

Instructions

Get specific page/document details with full content.

Returns: Dictionary with complete page details including JSON-formatted content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idYesThe unique Productive page identifier

Implementation Reference

  • Implements the core logic of the get_page tool: fetches the page from the Productive API client, applies response filtering, logs progress, and handles specific API errors and general exceptions.
    async def get_page(ctx: Context, page_id: int) -> ToolResult:
        """Fetch a single page by ID.
    
        Developer notes:
        - Body is JSON in attributes.body (caller may parse if needed).
        - Applies utils.filter_response to sanitize (body included via type='page').
        """
        try:
            await ctx.info(f"Fetching page with ID: {page_id}")
            result = await client.get_page(page_id)
            await ctx.info("Successfully retrieved page")
            
            filtered = filter_response(result)
            
            return filtered
            
        except ProductiveAPIError as e:
            await _handle_productive_api_error(ctx, e, f"page {page_id}")
        except Exception as e:
            await ctx.error(f"Unexpected error fetching page: {str(e)}")
            raise e
  • server.py:512-523 (registration)
    MCP registration of the 'get_page' tool using @mcp.tool decorator. Includes input schema definition via Annotated type hint and comprehensive docstring describing the tool's purpose and return value.
    @mcp.tool
    async def get_page(
        ctx: Context,
        page_id: Annotated[int, Field(description="The unique Productive page identifier")],
    ) -> Dict[str, Any]:
        """Get specific page/document details with full content.
    
        Returns:
            Dictionary with complete page details including JSON-formatted content
        """
        return await tools.get_page(ctx, page_id)
  • Pydantic schema definition for the page_id input parameter using Annotated with Field for description.
        page_id: Annotated[int, Field(description="The unique Productive page identifier")],
    ) -> Dict[str, Any]:
  • Supporting API client method that issues the HTTP GET request to the Productive API endpoint /pages/{page_id} to retrieve the raw page data.
    async def get_page(self, page_id: int) -> Dict[str, Any]:
        """Get page by ID"""
        return await self._request("GET", f"/pages/{str(page_id)}")

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/druellan/Productive-GET-MCP'

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