Skip to main content
Glama
saasus-platform

SaaSus Docs MCP Server

Official

saasusDocsContentTool

Retrieve full text content of a SaaSus Platform documentation article using its URL. Designed for use after obtaining article URLs from search or sitemap tools.

Instructions

Fetch the full content of a SaaSus Platform documentation article from its URL. Use this tool after getting URLs from saasus-docs-search-urls tool or saasus-docs-sitemap tool to retrieve the complete article content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the SaaSus Platform documentation article to fetch

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
titleYes
contentYes

Implementation Reference

  • The core logic that fetches and parses SaaSus documentation pages. It validates the URL (must be docs.saasus.io), fetches the HTML, extracts the title via regex, uses JSDOM to parse the DOM, selects the main article element (trying article.markdown, article, then main), removes unwanted nav elements, and converts the HTML to Markdown using TurndownService with anchor link removal.
    const fetchSaaSusDocsContent = async (
      url: string
    ): Promise<{ url: string; title: string; content: string }> => {
      if (!url) {
        throw new Error("URL is required");
      }
    
      // Ensure URL is a SaaSus Platform docs URL for security
      if (!url.startsWith("https://docs.saasus.io")) {
        throw new Error("URL must be a SaaSus Platform documentation URL");
      }
    
      const response = await fetch(url);
      if (!response.ok) {
        throw new Error(
          `HTTP ${response.status}: Failed to fetch content from ${url}`
        );
      }
    
      const html = await response.text();
    
      // Extract title from HTML
      const titleMatch = html.match(/<title[^>]*>([^<]*)<\/title>/i);
      const title = titleMatch ? titleMatch[1].replace(/\s+/g, " ").trim() : "";
    
      // Parse HTML with DOM to extract clean content
      const dom = new JSDOM(html);
      const document = dom.window.document;
    
      // Find the main article content
      let articleElement = document.querySelector("article.markdown");
      if (!articleElement) {
        articleElement = document.querySelector("article");
      }
      if (!articleElement) {
        articleElement = document.querySelector("main");
      }
    
      if (!articleElement) {
        throw new Error("Could not find article content");
      }
    
      // Remove unwanted elements using DOM manipulation
      const unwantedSelectors = [
        "nav", // Navigation elements
        "ul:first-child", // First ul is likely breadcrumb/navigation
      ];
    
      unwantedSelectors.forEach((selector) => {
        const elements = articleElement!.querySelectorAll(selector);
        elements.forEach((el) => el.remove());
      });
    
      // Convert to Markdown with enhanced settings
      const turndownService = new TurndownService({
        headingStyle: "atx",
        codeBlockStyle: "fenced",
        bulletListMarker: "-",
        emDelimiter: "*",
        strongDelimiter: "**",
      });
    
      // Add rule to remove anchor links
      turndownService.addRule("removeAnchorLinks", {
        filter: function (node: any) {
          return (
            node.nodeName === "A" && node.getAttribute("href")?.startsWith("#")
          );
        },
        replacement: function () {
          return "";
        },
      });
    
      const content = turndownService
        .turndown(articleElement.innerHTML)
        .replace(/\n{3,}/g, "\n\n") // Normalize line breaks
        .trim();
    
      return {
        url,
        title,
        content,
      };
    };
  • Input schema using Zod: expects a single `url` string parameter describing the SaaSus docs article URL to fetch.
    inputSchema: z.object({
      url: z
        .string()
        .describe(
          "The URL of the SaaSus Platform documentation article to fetch"
        ),
    }),
  • Output schema using Zod: returns an object with `url` (string), `title` (string), and `content` (string).
    outputSchema: z.object({
      url: z.string(),
      title: z.string(),
      content: z.string(),
    }),
  • The tool is registered on the MCPServer named 'SaaSus Platform Docs Search' along with saasusDocsSearchTool and saasusDocsSitemapTool.
    export const mcpServer = new MCPServer({
      name: "SaaSus Platform Docs Search",
      version: packageJson.version,
      tools: {
        saasusDocsSearchTool,
        saasusDocsContentTool,
        saasusDocsSitemapTool,
      },
    });
Behavior3/5

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

No annotations are provided, so the description must convey behavioral traits. It states 'fetch' implying a read-only operation, but does not disclose additional details like authentication requirements, rate limits, or whether content is cached. While not misleading, it is minimal.

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

Conciseness5/5

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

The description is two sentences long, front-loaded with the core action, and every sentence adds value. There is no redundant information.

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 simplicity (one required parameter, output schema exists), the description is complete. It covers what the tool does, when to use it, and refers to sibling tools for URL retrieval.

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

Parameters3/5

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

Schema coverage is 100%, and the description mentions the URL parameter but adds no extra meaning beyond what the schema already provides. The description does not clarify format or constraints (e.g., must be a valid SaaSus URL).

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 action ('Fetch the full content') and the specific resource ('SaaSus Platform documentation article from its URL'). It distinguishes from sibling tools by mentioning that it is used after getting URLs from the search or sitemap tools.

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

Usage Guidelines5/5

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

Explicit guidance is provided: 'Use this tool after getting URLs from saasus-docs-search-urls tool or saasus-docs-sitemap tool.' This tells the agent exactly when to invoke this tool relative to its siblings.

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

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