From 68322c16aec3f643a8f47722c8fe703a4339fbd8 Mon Sep 17 00:00:00 2001 From: Harshith Mullapudi Date: Thu, 2 Oct 2025 10:20:57 +0530 Subject: [PATCH] fix: mcp tools --- .../app/components/logs/log-details.tsx | 53 +++++++++---------- apps/webapp/app/utils/mcp/memory.ts | 2 - 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/apps/webapp/app/components/logs/log-details.tsx b/apps/webapp/app/components/logs/log-details.tsx index f6bbf43..ff50b57 100644 --- a/apps/webapp/app/components/logs/log-details.tsx +++ b/apps/webapp/app/components/logs/log-details.tsx @@ -87,33 +87,32 @@ export function LogDetails({ log }: LogDetailsProps) { // Fetch episode facts when dialog opens and episodeUUID exists useEffect(() => { - if (facts.length === 0) { - if (log.data?.type === "DOCUMENT" && log.data?.episodes?.length > 0) { - setFactsLoading(true); - // Fetch facts for all episodes in DOCUMENT type - Promise.all( - log.data.episodes.map((episodeId: string) => - fetch(`/api/v1/episodes/${episodeId}/facts`).then((res) => - res.json(), - ), + if (log.data?.type === "DOCUMENT" && log.data?.episodes?.length > 0) { + setFactsLoading(true); + setFacts([]); + // Fetch facts for all episodes in DOCUMENT type + Promise.all( + log.data.episodes.map((episodeId: string) => + fetch(`/api/v1/episodes/${episodeId}/facts`).then((res) => + res.json(), ), - ) - .then((results) => { - const allFacts = results.flatMap((result) => result.facts || []); - const allInvalidFacts = results.flatMap( - (result) => result.invalidFacts || [], - ); - setFacts(allFacts); - setInvalidFacts(allInvalidFacts); - setFactsLoading(false); - }) - .catch(() => { - setFactsLoading(false); - }); - } else if (log.episodeUUID) { - setFactsLoading(true); - fetcher.load(`/api/v1/episodes/${log.episodeUUID}/facts`); - } + ), + ) + .then((results) => { + const allFacts = results.flatMap((result) => result.facts || []); + const allInvalidFacts = results.flatMap( + (result) => result.invalidFacts || [], + ); + setFacts(allFacts); + setInvalidFacts(allInvalidFacts); + setFactsLoading(false); + }) + .catch(() => { + setFactsLoading(false); + }); + } else if (log.episodeUUID) { + setFactsLoading(true); + fetcher.load(`/api/v1/episodes/${log.episodeUUID}/facts`); } }, [log.episodeUUID, log.data?.type, log.data?.episodes, facts.length]); @@ -218,7 +217,7 @@ export function LogDetails({ log }: LogDetailsProps) { Content {/* Log Content */} -
+
{log.ingestText}
diff --git a/apps/webapp/app/utils/mcp/memory.ts b/apps/webapp/app/utils/mcp/memory.ts index 9fc7fec..4cdf383 100644 --- a/apps/webapp/app/utils/mcp/memory.ts +++ b/apps/webapp/app/utils/mcp/memory.ts @@ -75,7 +75,6 @@ export const memoryTools = [ all: { type: "boolean", description: "Get all spaces", - default: true, }, }, }, @@ -90,7 +89,6 @@ export const memoryTools = [ profile: { type: "boolean", description: "Get user profile", - default: true, }, }, },