list_documentation_sections
Lists all available documentation sections with descriptions, enabling you to identify and fetch the specific section you need.
Instructions
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
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The actual handler function 'list_documentation_sections' that executes the tool logic. It retrieves supported documentation sections from the fetcher, formats them as markdown, and returns the list.
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}" - The @mcp.tool() decorator that registers 'list_documentation_sections' as a FastMCP tool with annotations including title, readOnlyHint, and description.
@mcp.tool( annotations={ "title": "List Available Documentation Sections", "readOnlyHint": True, "description": "Lists all available Ilograph documentation sections with descriptions", } ) - src/ilograph_mcp/server.py:59-62 (registration)The registration call in server.py that invokes register_fetch_documentation_tool(mcp), which registers all documentation tools including list_documentation_sections via the decorator.
try: # Register all tools with error handling register_fetch_documentation_tool(mcp) logger.info("Registered fetch_documentation_tool") - The 'get_supported_documentation_sections()' helper method on IlographContentFetcher that provides the dictionary of section names to descriptions used by the handler.
def get_supported_documentation_sections(self) -> Dict[str, str]: """ Get the list of supported documentation sections with descriptions. Returns: Dictionary mapping section names to descriptions """ return { "resources": "Resource tree organization, hierarchies, instanceOf patterns, abstract resources", "relation-perspectives": "Arrow connections, from/to properties, routing, labels, directions", "sequence-perspectives": "Time-based diagrams with steps, bidirectional flows, async operations", "references": "Resource reference patterns and advanced referencing techniques", "advanced-references": "Complex reference scenarios and advanced usage patterns", "resource-sizes-and-positions": "Layout control, resource sizing, visual hierarchy management", "parent-overrides": "Resource parent overrides in perspectives with scale properties", "perspectives-other-properties": "Additional perspective properties and configuration 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, context switching", "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", } - The get_tool_info() helper function that lists 'list_documentation_sections' as one of the registered documentation tools for external reference.
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", ], }