Skip to main content
Glama

get_topnavbar

Get the complete TopNavBar HTML, including logo, subscription, icons, avatar, and navigation tabs, with all icon paths pre-filled, ready to paste into your project.

Instructions

Returns the COMPLETE TopNavBar HTML ready to paste. Includes both Row 1 (logo, subscription, icons, avatar) and Row 2 (navigation tabs). All icon paths pre-filled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_topnavbar tool. It reads the topnavbar.md wiki file via readWikiFile(), extracts the HTML block under the 'Complete HTML' section, rewrites asset paths to point to the CDN, and returns the ready-to-paste HTML.
    server.tool("get_topnavbar", "Returns the complete TopNavBar HTML with all icon paths pre-filled as CDN URLs. Includes logo, navigation tabs, search, notification, and avatar. Copy directly into your HTML.", {}, async () => {
      const content = await readWikiFile("topnavbar.md");
      const html = rewriteAssetPaths(extractHtmlBlock(content, "Complete HTML"));
      return { content: [{ type: "text" as const, text: `## TopNavBar — Complete HTML (copy as-is)\nCDN: ${CDN_BASE}\nLogo: ${CDN_BASE}/assets/icons/logo-log360.svg\nAll icon paths are CDN URLs. Do NOT replace with inline SVG.\n\n\`\`\`html\n${html}\n\`\`\`` }] };
    });
  • api/mcp.ts:659-664 (registration)
    The tool registration using createMcpHandler. The tool is named 'get_topnavbar' and is registered with an empty schema (no inputs). The description mentions it returns complete TopNavBar HTML with CDN URLs.
    /* 12. get_topnavbar */
    server.tool("get_topnavbar", "Returns the complete TopNavBar HTML with all icon paths pre-filled as CDN URLs. Includes logo, navigation tabs, search, notification, and avatar. Copy directly into your HTML.", {}, async () => {
      const content = await readWikiFile("topnavbar.md");
      const html = rewriteAssetPaths(extractHtmlBlock(content, "Complete HTML"));
      return { content: [{ type: "text" as const, text: `## TopNavBar — Complete HTML (copy as-is)\nCDN: ${CDN_BASE}\nLogo: ${CDN_BASE}/assets/icons/logo-log360.svg\nAll icon paths are CDN URLs. Do NOT replace with inline SVG.\n\n\`\`\`html\n${html}\n\`\`\`` }] };
    });
  • readWikiFile helper — reads wiki .md files from a private GitHub repository with a 5-minute TTL cache. Used by get_topnavbar to fetch topnavbar.md.
    async function readWikiFile(filename: string): Promise<string> {
      const name = filename.endsWith(".md") ? filename : `${filename}.md`;
      const cached = wikiCache.get(name);
      if (cached && Date.now() - cached.fetchedAt < WIKI_CACHE_TTL_MS) {
        return cached.text;
      }
      if (!GH_TOKEN)
        return `[ERROR: ELEGANT_GH_TOKEN env var not set]`;
      try {
        // Cache-bust GitHub API with a timestamp parameter on cold miss
        const url = `https://api.github.com/repos/${PRIVATE_REPO}/contents/${WIKI_PATH}/${name}`;
        const res = await fetch(url, {
          headers: {
            Authorization: `Bearer ${GH_TOKEN}`,
            Accept: "application/vnd.github.raw+json",
            "X-GitHub-Api-Version": "2022-11-28",
            "Cache-Control": "no-cache",
          },
          cache: "no-store" as RequestCache,
        });
        if (!res.ok) return `[Wiki file not found: ${name} (${res.status})]`;
        const text = await res.text();
        wikiCache.set(name, { text, fetchedAt: Date.now() });
        return text;
      } catch (err: any) {
        return `[GitHub fetch error: ${err.message}]`;
      }
    }
  • rewriteAssetPaths helper — rewrites relative asset paths (./assets/, ../assets/, etc.) to point to the CDN base URL. Used by get_topnavbar to transform HTML from the wiki.
    function rewriteAssetPaths(html: string): string {
      // Match all relative forms: ./assets/, assets/, ../assets/, ../../assets/ ...
      // Covers: src="...", href="...", and any data-* attribute pointing at assets/
      // (e.g. data-icon, data-src, data-hover-icon — used by JS for dynamic swaps).
      return html
        .replace(/src=(["'])(?:\.\/|(?:\.\.\/)+)?assets\//g, (_m, q) => `src=${q}${CDN_BASE}/assets/`)
        .replace(/href=(["'])(?:\.\/|(?:\.\.\/)+)?assets\//g, (_m, q) => `href=${q}${CDN_BASE}/assets/`)
        .replace(/(data-[a-z-]+)=(["'])(?:\.\/|(?:\.\.\/)+)?assets\//g, (_m, attr, q) => `${attr}=${q}${CDN_BASE}/assets/`);
    }
  • extractHtmlBlock helper — extracts an HTML code block from markdown content, optionally scoped to a specific section heading. Used by get_topnavbar to extract the 'Complete HTML' section from topnavbar.md.
    function extractHtmlBlock(content: string, heading?: string): string {
      const src = heading ? extractSection(content, heading) : content;
      const match = src.match(/```html\n([\s\S]*?)```/);
      return match ? match[1].trim() : "[No HTML block found]";
    }
Behavior3/5

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

No annotations present; description covers output content but omits any behavioral traits like authentication needs or side effects. Minimally adequate.

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?

Two sentences, no filler, all information is essential and front-loaded.

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 zero parameters and a simple return value (HTML block), description captures everything needed for an agent to use the tool effectively.

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?

No parameters (empty schema), so baseline score of 4 applies. Description adds no parameter info, but none is needed.

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?

Clearly states it returns the complete TopNavBar HTML ready to paste, with specific mention of rows and prefilled icon paths. Distinct from sibling tools like get_component or get_icons.

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 guidance on when to use this tool versus alternatives. Lacks context about prerequisites or exclusions.

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/Anguraj-zoho/elegant-mcp'

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