Skip to main content
Glama

docs_health

Read-only

Check if SDK documentation is accessible. Call this first when documentation tools appear unavailable.

Instructions

Check SDK documentation availability. Call this first if docs tools seem unavailable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function that registers the docs_health tool on the MCP server. It checks GitBook health and returns either a success message with available tools or a warning with troubleshooting steps.
    function registerGitBookMetaTools(server: McpServer): void {
      // Tool to check GitBook MCP health
      server.tool(
        "docs_health",
        "Check SDK documentation availability. Call this first if docs tools seem unavailable.",
        {},
        DOCS_READ_ONLY,
        async () => {
          const health = await checkGitBookHealth();
          const tools = await fetchGitBookTools();
          
          if (health.healthy && tools.length > 0) {
            const toolNames = tools.slice(0, 5).map(t => `docs_${t.name}`).join(", ");
            return {
              content: [{
                type: "text",
                text: `✅ SDK Docs available. ${health.toolCount} tools ready.\n\nExample tools: ${toolNames}${tools.length > 5 ? "..." : ""}\n\nUse docs_list_tools for the full list, or call any docs_* tool directly.`
              }]
            };
          }
          
          return {
            content: [{
              type: "text",
              text: `⚠️ SDK Docs temporarily unavailable.\n\n**What you can do:**\n1. Try \`docs_refresh\` to reconnect\n2. Visit https://docs.sodax.com directly\n3. Use SODAX API tools (sodax_*) which work independently`
            }]
          };
        }
      );
  • Helper service function that checks GitBook MCP server reachability by attempting to fetch tools. Returns health status and tool count.
    export async function checkGitBookHealth(): Promise<{ healthy: boolean; toolCount: number }> {
      try {
        const tools = await fetchGitBookTools();
        return { healthy: true, toolCount: tools.length };
      } catch {
        return { healthy: false, toolCount: 0 };
      }
    }
  • Registration flow: registerGitBookProxyTools() is called from src/index.ts with the server instance, which calls registerGitBookMetaTools() that registers docs_health via server.tool().
    export async function registerGitBookProxyTools(server: McpServer): Promise<number> {
      let registeredCount = 0;
      
      // Register meta tools (work even if GitBook is down)
      registerGitBookMetaTools(server);
      
      try {
        const tools = await fetchGitBookTools();
        
        if (tools.length === 0) {
          console.error("No tools found from GitBook MCP - meta-tools registered, proxy tools skipped");
          return 0;
        }
        
        console.error(`Registering ${tools.length} GitBook tools as docs_* proxies...`);
        
        for (const tool of tools) {
          try {
            // Prefix with "docs_" to indicate these are from SDK docs
            const proxyToolName = `docs_${tool.name}`;
            const zodSchema = convertToZodSchema(tool.inputSchema);
            
            server.tool(
              proxyToolName,
              `[SDK Docs] ${tool.description}`,
              zodSchema._def.typeName === "ZodObject" 
                ? (zodSchema as z.ZodObject<z.ZodRawShape>).shape 
                : {},
              DOCS_READ_ONLY,
              async (args) => {
                const result = await callGitBookTool(tool.name, args as Record<string, unknown>);
                
                // Add helpful context if the call failed
                if (result.isError) {
                  return {
                    content: [{
                      type: "text" as const,
                      text: `⚠️ docs_${tool.name} failed: ${result.content[0]?.text || "Unknown error"}\n\nTry docs_refresh to reconnect, or visit https://docs.sodax.com directly.`
                    }],
                    isError: true
                  };
                }
                
                return {
                  content: result.content.map(c => ({
                    type: c.type as "text",
                    text: c.text || JSON.stringify(c)
                  })),
                  isError: result.isError
                };
              }
            );
            
            registeredCount++;
          } catch (toolError) {
            console.error(`Failed to register GitBook tool ${tool.name}:`, toolError);
          }
        }
        
        console.error(`Registered ${registeredCount} tools from GitBook MCP`);
      } catch (error) {
        console.error("Failed to register GitBook proxy tools:", error);
      }
      
      return registeredCount;
    }
  • src/index.ts:44-45 (registration)
    Top-level entry point where registerGitBookProxyTools is called during server creation, triggering docs_health registration.
    registerSodaxApiTools(server);
    await registerGitBookProxyTools(server);
  • Analytics mapping groups docs_health into 'sdk-docs' category for PostHog event tracking.
      // GitBook SDK docs meta-tools
      docs_health: "sdk-docs",
      docs_refresh: "sdk-docs",
      docs_list_tools: "sdk-docs",
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, establishing it as a safe read operation. The description adds behavioral context by stating it checks availability, which implies a network call or status check, and suggests a specific usage order. No contradiction.

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 a single, well-structured sentence. It front-loads the core purpose and includes actionable guidance without any wasted words.

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

Completeness4/5

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

Given the simplicity of the tool (no parameters, no output schema), the description is nearly complete. It covers the purpose and usage context. However, it could optionally mention the return format (e.g., boolean) for full completeness.

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

Parameters4/5

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

The tool has zero parameters, so schema coverage is 100% by default. With no parameters to describe, the description compensates sufficiently by explaining the tool's purpose, earning a baseline score of 4.

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 'Check SDK documentation availability' uses a specific verb (Check) and resource (SDK documentation availability). It clearly distinguishes from sibling tools like docs_getPage (get a page) and docs_searchDocumentation (search), as it is a health check.

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 explicitly advises 'Call this first if docs tools seem unavailable.' This provides clear context for when to use the tool, but does not mention alternatives or when not to use it beyond that scenario.

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/gosodax/builders-sodax-mcp-server'

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