diegosouzapw/OmniRoute · error · Error

|| failedFetchMcpAudit

Error message

${json.error} || failedFetchMcpAudit

What it means

McpAuditTab's fetchAudit got a non-OK from /api/mcp/audit (limit/offset/tool/success filters). The JSON body is parsed defensively (.catch(() => ({}))) so a non-JSON error page still yields the localized 'failedFetchMcpAudit' fallback; data.error wins when present.

Solutions

  1. Confirm tool/success/offset filter params are accepted by the audit route
  2. Return structured error bodies from the MCP audit endpoint
  3. Check server logs for the failing audit query
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/audit/McpAuditTab.tsx:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/f34bce171ea88ede. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/audit/McpAuditTab.tsx:74

  }, []);

  useEffect(() => {
    void fetchStats();
  }, [fetchStats]);

  const fetchAudit = useCallback(async () => {
    setLoading(true);
    try {
      const params = new URLSearchParams();
      params.set("limit", String(MCP_PAGE_SIZE));
      params.set("offset", String(offset));
      if (toolFilter) params.set("tool", toolFilter);
      if (successFilter !== "all") params.set("success", successFilter);

      const response = await fetch(`/api/mcp/audit?${params.toString()}`);
      const json = await response.json().catch(() => ({}));
      if (!response.ok) {
        throw new Error(json.error || t("failedFetchMcpAudit"));
      }

      setData({
        entries: Array.isArray(json.entries) ? json.entries : [],
        total: Number(json.total || 0),
        limit: Number(json.limit || MCP_PAGE_SIZE),
        offset: Number(json.offset || offset),
      });
    } finally {
      setLoading(false);
    }
  }, [offset, successFilter, t, toolFilter]);

  useEffect(() => {
    void fetchAudit();
  }, [fetchAudit]);

  return (

View on GitHub (pinned to a179ffed5b)