Skip to main content
Glama

filament_discover_docs

Find live documentation routes for FilamentPHP admin panels to access official guides and component references for building Laravel applications.

Instructions

Discover live documentation routes from filamentphp.com

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
versionNo5.x

Implementation Reference

  • The core logic for discovering documentation routes from filamentphp.com.
    export async function discoverDocRoutes(version: "4.x" | "5.x"): Promise<DiscoveredDocRoute[]> {
      const docsRootUrl = `${DOCS_BASE_URL}/${version}`;
    
      try {
        const html = await fetchHtml(docsRootUrl);
        const $ = cheerio.load(html);
        const routes = new Map<string, DiscoveredDocRoute>();
    
        $("a[href]").each((_, link) => {
          const href = $(link).attr("href");
          if (!href) {
            return;
          }
    
          const absolute = href.startsWith("http") ? href : `https://filamentphp.com${href}`;
          const routeMatch = absolute.match(new RegExp(`/docs/${version}/([^/#?]+)/([^/#?]+)`));
    
          if (!routeMatch) {
            return;
          }
    
          const category = normalizeSegment(routeMatch[1]);
  • The MCP tool registration and response handling for 'filament_discover_docs'.
    server.tool("filament_discover_docs", "Discover live documentation routes from filamentphp.com", {
      version: versionSchema,
    }, async ({ version }) => {
      try {
        const routes = await discoverDocRoutes(version);
    
        if (routes.length === 0) {
          return {
            content: [{
              type: "text",
              text: "# No Live Routes Found\n\nCould not discover documentation routes right now. Use `filament_list_docs` for fallback static sections.",
            }],
          };
        }
    
        return {
          content: [{
            type: "text",
            text: `# Live Docs Routes (${version})\n\n${routes.map((route) => `- ${route.category}/${route.section} → ${route.url}`).join("\n")}`,
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: formatErrorMessage("Docs Route Discovery Failed", error, "Try again shortly or use `filament_list_docs`."),
          }],
        };

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/serbansorin/filament-mcp-server'

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