Skip to main content
Glama

fetchFullContent

Retrieves complete content from preview search results to access full articles, documents, or web pages in markdown, text, or HTML formats.

Instructions

Busca conteúdo completo de um resultado anterior de RAG obtido em contentMode=preview

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentHandleYesHandle do conteúdo obtido em contentMode=preview da ferramenta rag
outputFormatNoFormato de saída do conteúdomarkdown

Implementation Reference

  • Core execution logic for the fetchFullContent tool. Decodes the content handle to retrieve URL, fetches from cache, handles errors, and returns formatted content based on outputFormat.
    export async function fetchFullContent( params: FetchFullContentParams ): Promise<FetchResult> { const { contentHandle, outputFormat = "markdown" } = params; const url = decodeContentHandle(contentHandle); if (!url) { return { url: "", title: "", error: "Invalid contentHandle format. Ensure it was generated by rag() tool.", }; } const cached = getFromCache(url); if (!cached) { return { url, title: "", error: `Content not found in cache. Cache TTL is 1 hour. Please run rag() again to re-fetch and cache the content.`, }; } const result: FetchResult = { url: cached.url, title: cached.title, cached: true, contentLength: outputFormat === "markdown" ? cached.markdown.length : cached.content.length, }; if (outputFormat === "markdown") { result.markdown = cached.markdown; } else if (outputFormat === "text") { result.text = cached.content; } else if (outputFormat === "html") { result.html = cached.content; } return result; }
  • src/index.ts:61-80 (registration)
    MCP server tool registration for 'fetchFullContent', including description, Zod input schema, and wrapper handler that invokes the core fetchFullContent function and formats the MCP response.
    server.tool( "fetchFullContent", "Busca conteúdo completo de um resultado anterior de RAG obtido em contentMode=preview", { contentHandle: z .string() .min(1) .describe("Handle do conteúdo obtido em contentMode=preview da ferramenta rag"), outputFormat: z .enum(["markdown", "text", "html"]) .default("markdown") .describe("Formato de saída do conteúdo"), }, async (params) => { const result = await fetchFullContent(params); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } );
  • TypeScript interface defining the output structure of the fetchFullContent function.
    interface FetchResult { url: string; title: string; markdown?: string; text?: string; html?: string; contentLength?: number; cached?: boolean; error?: string; }
  • TypeScript interface defining the input parameters for the fetchFullContent function.
    interface FetchFullContentParams { contentHandle: string; outputFormat?: "markdown" | "text" | "html"; }
  • Zod schema defining the input validation for the MCP tool registration.
    { contentHandle: z .string() .min(1) .describe("Handle do conteúdo obtido em contentMode=preview da ferramenta rag"), outputFormat: z .enum(["markdown", "text", "html"]) .default("markdown") .describe("Formato de saída do conteúdo"), },

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/alucardeht/isis-mcp'

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