Skip to main content
Glama

get_full_wiki_file

Fetch the full content of a wiki markdown file, useful when partial retrieval tools like get_component are insufficient—for example, to read CSS details for a specific design variant.

Instructions

Returns the COMPLETE content of a wiki .md file. Use only when get_component / get_recipe aren't enough (e.g. reading CSS section for a specific variant). Prefer get_component for HTML snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesWiki filename without path (e.g. 'drawer.md', 'form_input.md')

Implementation Reference

  • api/mcp.ts:654-657 (registration)
    Registration of the 'get_full_wiki_file' tool using server.tool(). Defines a 'filename' string parameter and calls readWikiFile() to fetch the full .md file content.
    /* 11. get_full_wiki_file */
    server.tool("get_full_wiki_file", "Returns the COMPLETE content of a wiki .md file. Use only when get_component isn't enough (e.g. you need CSS details or variant rules). Do NOT read wiki files from the local filesystem — this tool fetches them from the server.", { filename: z.string().describe("Wiki filename (e.g. 'drawer.md', 'form_input.md', 'header.md')") }, async ({ filename }) => {
      return { content: [{ type: "text" as const, text: rewriteAssetPaths(await readWikiFile(filename)) }] };
    });
  • The readWikiFile() helper function that 'get_full_wiki_file' delegates to. Fetches wiki .md files from GitHub API with 5-minute TTL caching. Also handles .md extension appending and error responses.
    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}]`;
      }
    }
  • The rewriteAssetPaths() helper called on the returned wiki content. It rewrites relative asset paths (./assets/, ../assets/, etc.) to full CDN URLs before returning the content to the user.
    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/`);
    }
Behavior3/5

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

No annotations exist, so description carries full burden. It states 'COMPLETE content' but lacks details on potential side effects, auth needs, or performance implications. For a simple read tool, this is adequate but not exceptional.

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, front-loads the purpose, and every word adds value with no redundancy or superfluous 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?

For a simple tool with one string parameter and no output schema, the description covers all necessary aspects: what it returns, when to use, and input format, making it fully complete.

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 sole parameter 'filename' is described with concrete examples ('drawer.md'), adding meaning beyond the schema's type and requirement. Schema coverage is 100%, and examples enhance usability.

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 tool returns COMPLETE content of a wiki .md file, and explicitly distinguishes from siblings like get_component and get_recipe, making the purpose unambiguous.

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?

It provides explicit guidance on when to use ('Use only when get_component / get_recipe aren't enough') and suggests preferring get_component for HTML snippets, offering clear context and alternatives.

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