Skip to main content
Glama
InsForge

Insforge MCP Server

fetch-docs

Retrieve Insforge documentation for backend setup, SDKs, and components. Start with essential instructions, then access specific guides for database, authentication, storage, functions, AI integration, or real-time features.

Instructions

Fetch Insforge documentation. Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
docTypeYes Documentation type: "instructions" (essential backend setup - use FIRST), "db-sdk" (database operations), "storage-sdk" (file storage), "functions-sdk" (edge functions), "auth-components-react" (authentication components for React+Vite applications), "auth-components-nextjs" (authentication components for Next.js applications), "ai-integration-sdk" (AI features), "real-time" (real-time pub/sub through WebSockets)

Implementation Reference

  • Core handler logic for the 'fetch-docs' tool. Fetches documentation using fetchDocumentation helper, adds background context, and handles specific errors like 404.
    withUsageTracking('fetch-docs', async ({ docType }) => {
      try {
        const content = await fetchDocumentation(docType);
    
        return await addBackgroundContext({
          content: [
            {
              type: 'text',
              text: content,
            },
          ],
        });
      } catch (error) {
        const errMsg = error instanceof Error ? error.message : 'Unknown error occurred';
    
        // Friendly error for not found (likely due to old backend version)
        if (errMsg.includes('404') || errMsg.toLowerCase().includes('not found')) {
          return {
            content: [{
              type: 'text' as const,
              text: `Documentation for "${docType}" is not available. This is likely because your backend version is too old and doesn't support this documentation endpoint yet. This won't affect the functionality of the tools - they will still work correctly.`
            }],
          };
        }
    
        // Generic error response - no background context
        return {
          content: [{ type: 'text' as const, text: `Error fetching ${docType} documentation: ${errMsg}` }],
        };
      }
    })
  • Registration of the 'fetch-docs' tool on the MCP server, including name, description, input schema, and handler function.
      'fetch-docs',
      'Fetch Insforge documentation. Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.',
      {
        docType: docTypeSchema
      },
      withUsageTracking('fetch-docs', async ({ docType }) => {
        try {
          const content = await fetchDocumentation(docType);
    
          return await addBackgroundContext({
            content: [
              {
                type: 'text',
                text: content,
              },
            ],
          });
        } catch (error) {
          const errMsg = error instanceof Error ? error.message : 'Unknown error occurred';
    
          // Friendly error for not found (likely due to old backend version)
          if (errMsg.includes('404') || errMsg.toLowerCase().includes('not found')) {
            return {
              content: [{
                type: 'text' as const,
                text: `Documentation for "${docType}" is not available. This is likely because your backend version is too old and doesn't support this documentation endpoint yet. This won't affect the functionality of the tools - they will still work correctly.`
              }],
            };
          }
    
          // Generic error response - no background context
          return {
            content: [{ type: 'text' as const, text: `Error fetching ${docType} documentation: ${errMsg}` }],
          };
        }
      })
    );
  • Input schema definition for the tool using imported docTypeSchema Zod schema.
      docType: docTypeSchema
    },
  • Helper function that performs the HTTP request to fetch documentation from the backend API endpoint `/api/docs/${docType}` and processes/replaces URLs in the content.
    const fetchDocumentation = async (docType: string): Promise<string> => {
      try {
        const response = await fetch(`${API_BASE_URL}/api/docs/${docType}`, {
          method: 'GET',
          headers: {
            'Content-Type': 'application/json',
          },
        });
    
        // Check for 404 before processing response
        if (response.status === 404) {
          throw new Error('Documentation not found. This feature may not be supported in your project version. Please contact the Insforge team for assistance.');
        }
    
        const result = await handleApiResponse(response);
    
        if (result && typeof result === 'object' && 'content' in result) {
          let content = result.content;
          // Replace all example/placeholder URLs with actual API_BASE_URL
          // Handle URLs whether they're in backticks, quotes, or standalone
          // Preserve paths after the domain by only replacing the base URL
          content = content.replace(/http:\/\/localhost:7130/g, API_BASE_URL);
          content = content.replace(/https:\/\/your-app\.region\.insforge\.app/g, API_BASE_URL);
          return content;
        }
    
        throw new Error('Invalid response format from documentation endpoint');
      } catch (error) {
        const errMsg = error instanceof Error ? error.message : 'Unknown error occurred';
        throw new Error(`Unable to retrieve ${docType} documentation: ${errMsg}`);
      }
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions fetching documentation but lacks details on how the tool behaves: e.g., whether it returns raw text, formatted content, links, or errors; if there are rate limits; authentication requirements; or any side effects. The description is minimal beyond the basic action, leaving significant behavioral gaps.

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 highly concise and front-loaded: a single sentence that states the purpose and usage guidelines efficiently. Every word serves a purpose, with no wasted information, making it easy for an agent to parse and apply.

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

Completeness3/5

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

Given the tool's simplicity (1 parameter, 100% schema coverage, no output schema), the description is adequate but not fully complete. It lacks details on return values (no output schema provided) and behavioral aspects like error handling or format. For a fetch tool with no annotations, more context on what 'fetch' entails would improve completeness.

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 description coverage is 100%, with the docType parameter fully documented in the schema, including enum values and descriptions. The description adds some semantic context by emphasizing 'instructions' as mandatory first and grouping SDK types, but this mostly reiterates schema info. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Fetch Insforge documentation.' It specifies the resource (Insforge documentation) and the action (fetch), though it doesn't explicitly distinguish itself from siblings beyond the documentation-fetching context. The mention of specific SDK categories adds specificity but doesn't fully differentiate from potential documentation-related siblings.

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?

The description provides explicit guidance on when to use this tool: 'Use "instructions" for essential backend setup (MANDATORY FIRST), or select specific SDK docs for database, auth, storage, functions, or AI integration.' It clearly indicates the priority of 'instructions' and lists alternative documentation types for different needs, offering strong contextual direction.

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/InsForge/insforge-mcp'

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