Skip to main content
Glama
pinzonjulian

Turbo Docs MCP Server

by pinzonjulian

handbook-page-refreshes

Refresh web pages while preserving scroll position and DOM state using morphing techniques. Learn to update content without full reloads, exclude specific sections, and manage refresh streams for improved user experience.

Instructions

Page refresh techniques with morphing - learn about smooth page updates using DOM morphing with idiomorph, scroll preservation, excluding sections from morphing, and broadcasting refresh streams

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The anonymous async handler function for the 'handbook-page-refreshes' tool (shared with other doc tools). It reads the specific markdown file using readMarkdownFile and returns the content as a text block, or an error message.
    async () => {
      try {
        const content = await readMarkdownFile(path.join(folder, file));
        return {
          content: [
            {
              type: "text",
              text: content
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text",
              text: `Error reading ${file}: ${errorMessage}`
            }
          ]
        };
      }
    }
  • src/index.ts:17-45 (registration)
    Registers all documentation tools, including 'handbook-page-refreshes', by iterating over docFiles config and calling server.tool(name, description, handlerFn).
    docFiles.forEach(({ folder, file, name, description }) => {
      server.tool(
        name,
        description,
        async () => {
          try {
            const content = await readMarkdownFile(path.join(folder, file));
            return {
              content: [
                {
                  type: "text",
                  text: content
                }
              ]
            };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            return {
              content: [
                {
                  type: "text",
                  text: `Error reading ${file}: ${errorMessage}`
                }
              ]
            };
          }
        }
      );
    });
  • Configuration entry defining the name, description, folder, and file for the 'handbook-page-refreshes' tool.
      folder: 'handbook',
      file: '03_page_refreshes.md',
      name: 'handbook-page-refreshes'
      , description: 'Page refresh techniques with morphing - learn about smooth page updates using DOM morphing with idiomorph, scroll preservation, excluding sections from morphing, and broadcasting refresh streams'
    },
  • Supporting utility function readMarkdownFile that loads the markdown content for handbook/03_page_refreshes.md from cache, GitHub raw, or local fallback.
    export async function readMarkdownFile(filename: string): Promise<string> {
      const filePath = path.join(docsFolder, filename);
      if (!filePath.startsWith(docsFolder)) {
        throw new Error("Invalid file path");
      }
      
      // Get current commit info if we don't have it yet
      if (!mainBranchInfo) {
        try {
          const commitInfo = await fetchMainBranchInformation();
          const cacheKey = `${commitInfo.sha.substring(0, 7)}-${commitInfo.timestamp}`;
          mainBranchInfo = {
            ...commitInfo,
            cacheKey
          };
        } catch (shaError) {
          console.error('Failed to get GitHub commit info, falling back to direct fetch');
        }
      }
      
      // Try to read from cache first if we have commit info
      if (mainBranchInfo) {
        const cachedFilePath = path.join(cacheFolder, mainBranchInfo.cacheKey, filename);
        try {
          const content = await fs.promises.readFile(cachedFilePath, "utf-8");
          console.error(`Using cached content for ${mainBranchInfo.cacheKey}: ${filename}`);
          return content;
        } catch (cacheError) {
          // Cache miss, continue to fetch from GitHub
        }
      }
      
      // Fetch from GitHub
      try {
        return await fetchFromGitHub(filename, mainBranchInfo?.cacheKey);
      } catch (githubError) {
        console.error(`GitHub fetch failed: ${githubError}, attempting to read from local files...`);
        
        // Fallback: read from local files
        try {
          return await fs.promises.readFile(filePath, "utf-8");
        } catch (localError) {
          const githubErrorMessage = githubError instanceof Error ? githubError.message : String(githubError);
          const localErrorMessage = localError instanceof Error ? localError.message : String(localError);
          throw new Error(`Failed to read file from GitHub (${githubErrorMessage}) and locally (${localErrorMessage})`);
        }
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions concepts like 'DOM morphing with idiomorph' and 'broadcasting refresh streams,' but doesn't disclose behavioral traits such as whether this is a read-only demonstration, requires specific permissions, has side effects, or involves rate limits. The description is informative about topics but lacks operational details.

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

Conciseness4/5

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

The description is a single, dense sentence that efficiently lists key concepts (e.g., smooth page updates, DOM morphing, scroll preservation). It's front-loaded with the main topic but could be slightly more structured for clarity. Every phrase adds value, though it's packed with technical terms.

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

Completeness2/5

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

Given no annotations, no output schema, and zero parameters, the description is incomplete for a tool that likely involves interactive or educational behavior. It lists concepts but doesn't explain what the tool actually does (e.g., is it a tutorial, a simulator, or a configuration tool?), leaving gaps in understanding its function and expected outcomes.

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 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, but that's acceptable here. Baseline is 4 for zero parameters, as there's nothing to compensate for.

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

Purpose3/5

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

The description vaguely states the tool is about 'page refresh techniques with morphing' and mentions learning about specific concepts, but it doesn't clearly specify what action the tool performs (e.g., does it demonstrate, configure, or test these techniques?). It distinguishes from siblings by focusing on page refresh/morphing rather than building, installing, or reference topics, but the verb is ambiguous.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives is provided. The description implies it's for learning about page refresh techniques, but it doesn't specify contexts, prerequisites, or exclusions. Sibling tools like 'handbook-streams' or 'reference-streams' might overlap, but no comparison is made.

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/pinzonjulian/turbo-docs-mcp-server'

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