get_wiki_page
Retrieve a specific wiki page by its ID to access detailed information, using session authentication for secure API integration with the Taiga project management platform.
Instructions
Gets a specific wiki page by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| wiki_page_id | Yes |
Implementation Reference
- src/server.py:1215-1233 (handler)The main handler function decorated with @mcp.tool for the 'get_wiki_page' tool. It authenticates the session, fetches the wiki page using the Taiga API client, and handles errors.@mcp.tool("get_wiki_page", description="Gets a specific wiki page by its ID.") def get_wiki_page(session_id: str, wiki_page_id: int) -> Dict[str, Any]: """Retrieves wiki page details by ID.""" logger.info( f"Executing get_wiki_page ID {wiki_page_id} for session {session_id[:8]}...") taiga_client_wrapper = _get_authenticated_client(session_id) # Use wrapper variable name try: # Wiki expects wiki_page_id as a positional argument page = taiga_client_wrapper.api.wiki.get(wiki_page_id) # return page.to_dict() # Remove .to_dict() return page # Return directly except TaigaException as e: logger.error( f"Taiga API error getting wiki page {wiki_page_id}: {e}", exc_info=False) raise e except Exception as e: logger.error( f"Unexpected error getting wiki page {wiki_page_id}: {e}", exc_info=True) raise RuntimeError(f"Server error getting wiki page: {e}")
- src/server.py:1215-1215 (registration)The @mcp.tool decorator registers the get_wiki_page function as an MCP tool.@mcp.tool("get_wiki_page", description="Gets a specific wiki page by its ID.")
- src/server.py:39-52 (helper)Helper function used by get_wiki_page (and other tools) to retrieve and validate the authenticated Taiga client for the session.def _get_authenticated_client(session_id: str) -> TaigaClientWrapper: """ Retrieves the authenticated TaigaClientWrapper for a given session ID. Raises PermissionError if the session is invalid or not found. """ client = active_sessions.get(session_id) # Also check if the client object itself exists and is authenticated if not client or not client.is_authenticated: logger.warning(f"Invalid or expired session ID provided: {session_id}") # Raise PermissionError - FastMCP will map this to an appropriate error response raise PermissionError( f"Invalid or expired session ID: '{session_id}'. Please login again.") logger.debug(f"Retrieved valid client for session ID: {session_id}") return client