Skip to main content
Glama

get_article

Retrieve Document360 knowledge base articles by ID to access titles, content, tags, and metadata for documentation needs.

Instructions

Get article by ID from Document360

Args: article_id: Document360 article ID (UUID string) ctx: MCP context for logging and error handling

Returns: Article information including title, content, tags, and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
article_idYesDocument360 article ID (UUID string)

Implementation Reference

  • The core handler function that executes the 'get_article' tool logic: fetches article data using Document360 client, provides MCP context logging, and handles specific API errors.
    async def get_article(article_id: str, ctx: Context) -> Dict[str, Any]:
        """Get article by ID from Document360
        
        Args:
            article_id: Document360 article ID (UUID string)
            ctx: MCP context for logging and error handling
            
        Returns:
            Article data from Document360 API
        """
        try:
            await ctx.info(f"Fetching article with ID: {article_id}")
            
            result = await client.get_article(article_id)
            
            await ctx.info(f"Successfully retrieved article: {result.get('data', {}).get('title', 'Unknown')}")
            return result
            
        except Document360APIError as e:
            await ctx.error(f"Document360 API error: {e.message}")
            if e.status_code == 404:
                await ctx.warning(f"Article {article_id} not found")
            elif e.status_code == 401:
                await ctx.error("Invalid API key - check configuration")
            raise e
        except Exception as e:
            await ctx.error(f"Unexpected error fetching article: {str(e)}")
            raise e
  • server.py:58-72 (registration)
    MCP tool registration for 'get_article' using @mcp.tool decorator. Includes input schema via Annotated[str, Field] and docstring. Delegates execution to the handler in inc/tools.py.
    @mcp.tool
    async def get_article(
        article_id: Annotated[str, Field(description="Document360 article ID (UUID string)")],
        ctx: Context
    ) -> dict:
        """Get article by ID from Document360
        
        Args:
            article_id: Document360 article ID (UUID string)
            ctx: MCP context for logging and error handling
        
        Returns:
            Article information including title, content, tags, and metadata
        """
        return await tools.get_article(article_id, ctx)
  • Supporting utility in Document360Client class that makes the HTTP request to the Document360 API endpoint for retrieving an article by ID.
    async def get_article(self, article_id: str) -> Dict[str, Any]:
        """Get article by ID"""
        return await self._request("GET", f"/Articles/{article_id}/{config.langcode}?isForDisplay=false&isPublished={config.only_published}")

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/document360-mcp'

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