aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
index daf6ed941..090b9f5c9 100644
--- a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
+++ b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
@@ -283,7 +283,20 @@ export class CanvasDocsTool extends BaseTool<typeof parameterRules> {
try {
const includeSystemDocs = args.includeSystemDocs || false;
- const canvasDocs = this.getAllCanvasDocuments(includeSystemDocs);
+ const allCanvasDocs = this.getAllCanvasDocuments(includeSystemDocs);
+
+ // Filter out container/dashboard documents to only show actual content
+ const canvasDocs = allCanvasDocs.filter(doc => {
+ // Filter out collection containers and docking views (dashboards)
+ const isContainer = doc.type === 'collection' || doc._type_collection === 'Docking';
+ if (isContainer) {
+ console.log(`[CanvasDocsTool] Filtering out container document: ${doc.title || 'Untitled'} (type: ${doc.type}, _type_collection: ${doc._type_collection})`);
+ return false;
+ }
+ return true;
+ });
+
+ console.log(`[CanvasDocsTool] Found ${allCanvasDocs.length} total documents, ${canvasDocs.length} content documents after filtering containers`);
switch (args.action) {
case 'list': {