Skip to main content
Glama
saasus-platform

SaaSus Docs MCP Server

Official

saasusDocsSitemapTool

Fetch the sitemap XML from SaaSus Platform documentation to discover all available URLs and understand the complete site structure. Useful when search results are insufficient or you need to browse the full documentation hierarchy.

Instructions

Fetch the sitemap XML from SaaSus Platform documentation to get a list of all available URLs. Useful for discovering all documentation pages and their structure, especially when search doesn't return relevant results or you need to browse the complete site hierarchy. Use with saasus-docs-get-content tool to fetch specific article content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Defines the saasusDocsSitemapTool with id, description, input/output schemas, and execute handler that delegates to fetchSaaSusSitemap.
    export const saasusDocsSitemapTool = createTool({ id: "saasus-docs-sitemap", description: "Fetch the sitemap XML from SaaSus Platform documentation to get a list of all available URLs. Useful for discovering all documentation pages and their structure, especially when search doesn't return relevant results or you need to browse the complete site hierarchy. Use with saasus-docs-get-content tool to fetch specific article content.", inputSchema: z.object({}), outputSchema: z.object({ baseUrl: z.string(), structure: z.record(z.any()), }), execute: async () => { return await fetchSaaSusSitemap(); }, });
  • Implements the core logic for fetching, parsing, and structuring the SaaSus documentation sitemap into a hierarchical object.
    const fetchSaaSusSitemap = async (): Promise<{ baseUrl: string; structure: Record<string, any>; }> => { const sitemapUrl = "https://docs.saasus.io/ja/sitemap.xml"; const response = await fetch(sitemapUrl); if (!response.ok) { throw new Error( `HTTP ${response.status}: Failed to fetch sitemap from ${sitemapUrl}` ); } const xmlText = await response.text(); // Parse XML using JSDOM const dom = new JSDOM(xmlText, { contentType: "text/xml" }); const document = dom.window.document; const baseUrl = "https://docs.saasus.io"; const paths = Array.from(document.querySelectorAll("url")).map( (urlElement) => { const fullUrl = urlElement.querySelector("loc")?.textContent || ""; return fullUrl.replace(baseUrl, ""); } ); // Build compact hierarchical structure using arrays for leafs only const structure: Record<string, any> = {}; paths.forEach((path) => { if (!path) return; const segments = path.split("/").filter((segment) => segment); let current = structure; segments.forEach((segment, index) => { if (index === segments.length - 1) { // Last segment - set as 1 (endpoint marker) if (typeof current[segment] === "object") { current[segment]["/"] = 1; // Mark as endpoint in existing object } else { current[segment] = 1; // Simple endpoint } } else { // Intermediate segment if (!current[segment]) { current[segment] = {}; } else if (current[segment] === 1) { // Convert endpoint to object with endpoint marker current[segment] = { "/": 1 }; } current = current[segment]; } }); }); return { baseUrl, structure }; };
  • Registers saasusDocsSitemapTool in the tools map of the MCPServer instance.
    tools: { saasusDocsSearchTool, saasusDocsContentTool, saasusDocsSitemapTool, },
  • Zod schema definitions for the tool's input (no parameters) and output (baseUrl and structure).
    inputSchema: z.object({}), outputSchema: z.object({ baseUrl: z.string(), structure: z.record(z.any()), }),

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/saasus-platform/saasus-docs-mcp-server'

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