Skip to main content
Glama

fetch_documentation_tool

Read-only

Fetch and format official Ilograph documentation to learn concepts, tutorials, and implementation patterns in clean markdown.

Instructions

    Fetches and formats narrative documentation from Ilograph website.

    This tool provides detailed explanations, tutorials, and examples for learning
    Ilograph concepts and implementation patterns. Content is fetched from the official
    Ilograph documentation site and converted to clean markdown format.

    Args:
        section: Documentation section to fetch. Supported sections:
                - 'resources' -> Resource tree organization, hierarchies, instanceOf patterns
                - 'relation-perspectives' -> Arrow connections, from/to properties, routing, labels
                - 'sequence-perspectives' -> Time-based diagrams with steps, bidirectional flows
                - 'references' -> Resource reference patterns and advanced referencing
                - 'advanced-references' -> Complex reference scenarios and usage patterns
                - 'resource-sizes-and-positions' -> Layout control, resource sizing, visual hierarchy
                - 'parent-overrides' -> Resource parent overrides in perspectives with scale properties
                - 'perspectives-other-properties' -> Additional perspective properties and options
                - 'icons' -> Icon system with iconStyle, icon paths, and categorization
                - 'walkthroughs' -> Interactive step-by-step guides through diagrams
                - 'contexts' -> Multiple context views with roots, extends inheritance
                - 'imports' -> Namespace management with from/namespace properties, component reuse
                - 'markdown' -> Rich text support in descriptions, notes, and diagram text
                - 'tutorial' -> Complete tutorial for learning Ilograph diagram creation

    Returns:
        str: Clean markdown content with detailed explanations, examples, and best practices
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionYes

Implementation Reference

  • The primary handler function decorated with @mcp.tool, implementing the core logic for fetching, validating, formatting, and returning Ilograph documentation sections as markdown.
        @mcp.tool(
            annotations={
                "title": "Fetch Ilograph Documentation",
                "readOnlyHint": True,
                "description": "Fetches narrative documentation from ilograph.com with explanations and examples",
            }
        )
        async def fetch_documentation_tool(section: str, ctx: Context) -> str:
            """
            Fetches and formats narrative documentation from Ilograph website.
    
            This tool provides detailed explanations, tutorials, and examples for learning
            Ilograph concepts and implementation patterns. Content is fetched from the official
            Ilograph documentation site and converted to clean markdown format.
    
            Args:
                section: Documentation section to fetch. Supported sections:
                        - 'resources' -> Resource tree organization, hierarchies, instanceOf patterns
                        - 'relation-perspectives' -> Arrow connections, from/to properties, routing, labels
                        - 'sequence-perspectives' -> Time-based diagrams with steps, bidirectional flows
                        - 'references' -> Resource reference patterns and advanced referencing
                        - 'advanced-references' -> Complex reference scenarios and usage patterns
                        - 'resource-sizes-and-positions' -> Layout control, resource sizing, visual hierarchy
                        - 'parent-overrides' -> Resource parent overrides in perspectives with scale properties
                        - 'perspectives-other-properties' -> Additional perspective properties and options
                        - 'icons' -> Icon system with iconStyle, icon paths, and categorization
                        - 'walkthroughs' -> Interactive step-by-step guides through diagrams
                        - 'contexts' -> Multiple context views with roots, extends inheritance
                        - 'imports' -> Namespace management with from/namespace properties, component reuse
                        - 'markdown' -> Rich text support in descriptions, notes, and diagram text
                        - 'tutorial' -> Complete tutorial for learning Ilograph diagram creation
    
            Returns:
                str: Clean markdown content with detailed explanations, examples, and best practices
            """
            # Validate and normalize section parameter
            if not section or not isinstance(section, str):
                error_msg = "Section parameter is required and must be a non-empty string"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
    
            section = section.strip().lower()
    
            # Get fetcher instance
            fetcher = get_fetcher()
            supported_sections = fetcher.get_supported_documentation_sections()
    
            # Validate section name
            if section not in supported_sections:
                available_sections = ", ".join(sorted(supported_sections.keys()))
                error_msg = f"Unsupported section '{section}'. Available sections: {available_sections}"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
    
            try:
                # Log the request
                await ctx.info(f"Fetching Ilograph documentation for section: {section}")
    
                # Fetch documentation content
                content = await fetcher.fetch_documentation_section(section)
    
                if content is None:
                    error_msg = f"Failed to fetch documentation for section '{section}'. The content may be temporarily unavailable."
                    await ctx.error(error_msg)
                    return f"Error: {error_msg}"
    
                # Add metadata header to the content
                section_description = supported_sections[section]
                content_with_header = f"""# Ilograph Documentation: {section.replace('-', ' ').title()}
    
    **Section:** {section}  
    **Description:** {section_description}  
    **Source:** https://www.ilograph.com/docs/editing/{section.replace('-', '/')}/  
    **Last Updated:** Fetched on demand from official Ilograph documentation
    
    ---
    
    {content}
    
    ---
    
    *This documentation was fetched from the official Ilograph website and converted to markdown format for easy consumption. For the most up-to-date information, visit the official documentation at https://www.ilograph.com/docs/*
    """
    
                await ctx.info(
                    f"Successfully fetched documentation for section '{section}' ({len(content)} characters)"
                )
                return content_with_header
    
            except Exception as e:
                error_msg = f"Unexpected error fetching documentation for section '{section}': {str(e)}"
                await ctx.error(error_msg)
                return f"Error: An unexpected error occurred while fetching the documentation. Please try again later."
  • The point where the fetch_documentation_tool is registered on the FastMCP server instance by calling the registration function.
    register_fetch_documentation_tool(mcp)
    logger.info("Registered fetch_documentation_tool")
  • The registration function that defines and attaches the tool handler to the MCP server using the @mcp.tool decorator.
    def register_fetch_documentation_tool(mcp: FastMCP) -> None:
        """Register the fetch documentation tool with the FastMCP server."""
    
        @mcp.tool(
            annotations={
                "title": "Fetch Ilograph Documentation",
                "readOnlyHint": True,
                "description": "Fetches narrative documentation from ilograph.com with explanations and examples",
            }
        )
        async def fetch_documentation_tool(section: str, ctx: Context) -> str:
            """
            Fetches and formats narrative documentation from Ilograph website.
    
            This tool provides detailed explanations, tutorials, and examples for learning
            Ilograph concepts and implementation patterns. Content is fetched from the official
            Ilograph documentation site and converted to clean markdown format.
    
            Args:
                section: Documentation section to fetch. Supported sections:
                        - 'resources' -> Resource tree organization, hierarchies, instanceOf patterns
                        - 'relation-perspectives' -> Arrow connections, from/to properties, routing, labels
                        - 'sequence-perspectives' -> Time-based diagrams with steps, bidirectional flows
                        - 'references' -> Resource reference patterns and advanced referencing
                        - 'advanced-references' -> Complex reference scenarios and usage patterns
                        - 'resource-sizes-and-positions' -> Layout control, resource sizing, visual hierarchy
                        - 'parent-overrides' -> Resource parent overrides in perspectives with scale properties
                        - 'perspectives-other-properties' -> Additional perspective properties and options
                        - 'icons' -> Icon system with iconStyle, icon paths, and categorization
                        - 'walkthroughs' -> Interactive step-by-step guides through diagrams
                        - 'contexts' -> Multiple context views with roots, extends inheritance
                        - 'imports' -> Namespace management with from/namespace properties, component reuse
                        - 'markdown' -> Rich text support in descriptions, notes, and diagram text
                        - 'tutorial' -> Complete tutorial for learning Ilograph diagram creation
    
            Returns:
                str: Clean markdown content with detailed explanations, examples, and best practices
            """
            # Validate and normalize section parameter
            if not section or not isinstance(section, str):
                error_msg = "Section parameter is required and must be a non-empty string"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
    
            section = section.strip().lower()
    
            # Get fetcher instance
            fetcher = get_fetcher()
            supported_sections = fetcher.get_supported_documentation_sections()
    
            # Validate section name
            if section not in supported_sections:
                available_sections = ", ".join(sorted(supported_sections.keys()))
                error_msg = f"Unsupported section '{section}'. Available sections: {available_sections}"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
    
            try:
                # Log the request
                await ctx.info(f"Fetching Ilograph documentation for section: {section}")
    
                # Fetch documentation content
                content = await fetcher.fetch_documentation_section(section)
    
                if content is None:
                    error_msg = f"Failed to fetch documentation for section '{section}'. The content may be temporarily unavailable."
                    await ctx.error(error_msg)
                    return f"Error: {error_msg}"
    
                # Add metadata header to the content
                section_description = supported_sections[section]
                content_with_header = f"""# Ilograph Documentation: {section.replace('-', ' ').title()}
    
    **Section:** {section}  
    **Description:** {section_description}  
    **Source:** https://www.ilograph.com/docs/editing/{section.replace('-', '/')}/  
    **Last Updated:** Fetched on demand from official Ilograph documentation
    
    ---
    
    {content}
    
    ---
    
    *This documentation was fetched from the official Ilograph website and converted to markdown format for easy consumption. For the most up-to-date information, visit the official documentation at https://www.ilograph.com/docs/*
    """
    
                await ctx.info(
                    f"Successfully fetched documentation for section '{section}' ({len(content)} characters)"
                )
                return content_with_header
    
            except Exception as e:
                error_msg = f"Unexpected error fetching documentation for section '{section}': {str(e)}"
                await ctx.error(error_msg)
                return f"Error: An unexpected error occurred while fetching the documentation. Please try again later."
    
        @mcp.tool(
            annotations={
                "title": "List Available Documentation Sections",
                "readOnlyHint": True,
                "description": "Lists all available Ilograph documentation sections with descriptions",
            }
        )
        async def list_documentation_sections(ctx: Context) -> str:
            """
            Lists all available Ilograph documentation sections with descriptions.
    
            This tool provides an overview of all available documentation sections
            that can be fetched using the fetch_documentation_tool.
    
            Returns:
                str: Formatted list of available documentation sections with descriptions
            """
            try:
                await ctx.info("Listing available Ilograph documentation sections")
    
                fetcher = get_fetcher()
                supported_sections = fetcher.get_supported_documentation_sections()
    
                # Format the sections list
                sections_md = "# Available Ilograph Documentation Sections\n\n"
                sections_md += "The following documentation sections are available for fetching:\n\n"
    
                for section, description in sorted(supported_sections.items()):
                    url = f"https://www.ilograph.com/docs/editing/{section.replace('-', '/')}/"
                    sections_md += f"## {section}\n"
                    sections_md += f"**Description:** {description}  \n"
                    sections_md += f"**URL:** {url}  \n"
                    sections_md += f"**Usage:** Use `fetch_documentation_tool(section='{section}')` to fetch this content\n\n"
    
                sections_md += "---\n\n"
                sections_md += "*To fetch any of these sections, use the `fetch_documentation_tool` with the section name as the parameter.*"
    
                await ctx.info(f"Listed {len(supported_sections)} available documentation sections")
                return sections_md
    
            except Exception as e:
                error_msg = f"Error listing documentation sections: {str(e)}"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
    
        @mcp.tool(
            annotations={
                "title": "Check Documentation Service Health",
                "readOnlyHint": True,
                "description": "Checks the health and connectivity of the documentation fetching service",
            }
        )
        async def check_documentation_health(ctx: Context) -> str:
            """
            Checks the health and connectivity of the documentation fetching service.
    
            This tool performs connectivity tests and returns status information about
            the documentation fetching capabilities, including cache statistics.
    
            Returns:
                str: Health status report with service connectivity and cache information
            """
            try:
                await ctx.info("Performing documentation service health check")
    
                fetcher = get_fetcher()
                health_info = await fetcher.health_check()
    
                # Format health report
                health_md = "# Documentation Service Health Report\n\n"
                health_md += f"**Overall Status:** {health_info['status'].upper()}\n\n"
    
                # Service status
                health_md += "## Service Connectivity\n\n"
                for service, info in health_info["services"].items():
                    status_emoji = "✅" if info["status"] == "healthy" else "❌"
                    health_md += f"{status_emoji} **{service.title()}**: {info['status'].upper()}\n"
                    health_md += f"   - URL: {info['url']}\n"
                    if "error" in info:
                        health_md += f"   - Error: {info['error']}\n"
                    health_md += "\n"
    
                # Cache statistics
                cache_stats = health_info["cache_stats"]
                health_md += "## Cache Statistics\n\n"
                health_md += f"- **Total Entries:** {cache_stats['total_entries']}\n"
                health_md += f"- **Valid Entries:** {cache_stats['valid_entries']}\n"
                health_md += f"- **Expired Entries:** {cache_stats['expired_entries']}\n"
    
                if cache_stats["keys"]:
                    health_md += f"- **Cached Keys:** {', '.join(cache_stats['keys'])}\n"
    
                health_md += "\n---\n\n"
    
                if health_info["status"] == "healthy":
                    health_md += "*All services are operational and ready to fetch documentation.*"
                elif health_info["status"] == "degraded":
                    unhealthy = health_info.get("unhealthy_services", [])
                    health_md += f"*Some services are experiencing issues: {', '.join(unhealthy)}. Documentation fetching may be limited.*"
    
                await ctx.info(f"Health check completed - Status: {health_info['status']}")
                return health_md
    
            except Exception as e:
                error_msg = f"Error performing health check: {str(e)}"
                await ctx.error(error_msg)
                return f"Error: {error_msg}"
  • The docstring providing detailed schema information including input parameter 'section' with supported values and return type description.
    """
    Fetches and formats narrative documentation from Ilograph website.
    
    This tool provides detailed explanations, tutorials, and examples for learning
    Ilograph concepts and implementation patterns. Content is fetched from the official
    Ilograph documentation site and converted to clean markdown format.
    
    Args:
        section: Documentation section to fetch. Supported sections:
                - 'resources' -> Resource tree organization, hierarchies, instanceOf patterns
                - 'relation-perspectives' -> Arrow connections, from/to properties, routing, labels
                - 'sequence-perspectives' -> Time-based diagrams with steps, bidirectional flows
                - 'references' -> Resource reference patterns and advanced referencing
                - 'advanced-references' -> Complex reference scenarios and usage patterns
                - 'resource-sizes-and-positions' -> Layout control, resource sizing, visual hierarchy
                - 'parent-overrides' -> Resource parent overrides in perspectives with scale properties
                - 'perspectives-other-properties' -> Additional perspective properties and options
                - 'icons' -> Icon system with iconStyle, icon paths, and categorization
                - 'walkthroughs' -> Interactive step-by-step guides through diagrams
                - 'contexts' -> Multiple context views with roots, extends inheritance
                - 'imports' -> Namespace management with from/namespace properties, component reuse
                - 'markdown' -> Rich text support in descriptions, notes, and diagram text
                - 'tutorial' -> Complete tutorial for learning Ilograph diagram creation
    
    Returns:
        str: Clean markdown content with detailed explanations, examples, and best practices
    """
  • Helper function providing metadata and tool list for the fetch_documentation_tool and related tools.
    def get_tool_info() -> dict:
        """Get information about the documentation tools for registration."""
        return {
            "name": "fetch_documentation_tool",
            "description": "Fetches comprehensive Ilograph documentation with markdown formatting",
            "tools": [
                "fetch_documentation_tool",
                "list_documentation_sections",
                "check_documentation_health",
            ],
        }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint=true, and the description aligns with this by describing a fetch operation without contradictions. The description adds valuable behavioral context beyond annotations: it specifies the source ('official Ilograph documentation site'), output format ('clean markdown'), and content type ('detailed explanations, tutorials, examples, best practices').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and well-structured with clear sections (purpose, content type, args, returns). Every sentence adds value, though the parameter documentation section is quite detailed (necessary given schema gaps). It could be slightly more front-loaded by moving the returns statement earlier.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter with many possible values) and the absence of output schema, the description provides complete context. It explains what the tool does, what content it returns, all parameter options with semantics, and the return format. No annotations contradiction exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage (schema only has title 'Section' with no description), the description fully compensates by providing comprehensive parameter semantics. It documents all 16 supported section values with clear explanations of what each section contains, adding significant meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'fetches and formats narrative documentation from Ilograph website' with specific verb ('fetches'), resource ('documentation'), and format transformation ('converted to clean markdown format'). It distinguishes from siblings like 'check_documentation_health' (health monitoring) and 'list_documentation_sections' (listing only).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('for learning Ilograph concepts and implementation patterns') and mentions the source ('official Ilograph documentation site'). However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for similar documentation needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/QuincyMillerDev/ilograph-mcp-server'

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