@flowdot.ai/mcp-server 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +162 -162
- package/bin/flowdot-mcp.js +15 -15
- package/dist/api-client.d.ts +2 -344
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +2 -784
- package/dist/api-client.js.map +1 -1
- package/dist/resources/index.d.ts +12 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +2204 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +19 -10
- package/dist/server.js.map +1 -1
- package/dist/tools/add-recipe-step.d.ts +23 -0
- package/dist/tools/add-recipe-step.d.ts.map +1 -0
- package/dist/tools/add-recipe-step.js +196 -0
- package/dist/tools/add-recipe-step.js.map +1 -0
- package/dist/tools/add-recipe-store.d.ts +19 -0
- package/dist/tools/add-recipe-store.d.ts.map +1 -0
- package/dist/tools/add-recipe-store.js +116 -0
- package/dist/tools/add-recipe-store.js.map +1 -0
- package/dist/tools/agent-toolkits.d.ts +57 -0
- package/dist/tools/agent-toolkits.d.ts.map +1 -0
- package/dist/tools/agent-toolkits.js +1712 -0
- package/dist/tools/agent-toolkits.js.map +1 -0
- package/dist/tools/append-app-code.d.ts +12 -0
- package/dist/tools/append-app-code.d.ts.map +1 -0
- package/dist/tools/append-app-code.js +83 -0
- package/dist/tools/append-app-code.js.map +1 -0
- package/dist/tools/browse-recipes.d.ts +16 -0
- package/dist/tools/browse-recipes.d.ts.map +1 -0
- package/dist/tools/browse-recipes.js +102 -0
- package/dist/tools/browse-recipes.js.map +1 -0
- package/dist/tools/clone-app.js +20 -20
- package/dist/tools/create-app-file.d.ts +11 -0
- package/dist/tools/create-app-file.d.ts.map +1 -0
- package/dist/tools/create-app-file.js +83 -0
- package/dist/tools/create-app-file.js.map +1 -0
- package/dist/tools/create-app.d.ts.map +1 -1
- package/dist/tools/create-app.js +47 -29
- package/dist/tools/create-app.js.map +1 -1
- package/dist/tools/create-knowledge-category.d.ts +16 -0
- package/dist/tools/create-knowledge-category.d.ts.map +1 -0
- package/dist/tools/create-knowledge-category.js +71 -0
- package/dist/tools/create-knowledge-category.js.map +1 -0
- package/dist/tools/create-recipe.d.ts +16 -0
- package/dist/tools/create-recipe.d.ts.map +1 -0
- package/dist/tools/create-recipe.js +92 -0
- package/dist/tools/create-recipe.js.map +1 -0
- package/dist/tools/delete-app-file.d.ts +11 -0
- package/dist/tools/delete-app-file.d.ts.map +1 -0
- package/dist/tools/delete-app-file.js +52 -0
- package/dist/tools/delete-app-file.js.map +1 -0
- package/dist/tools/delete-app.js +3 -3
- package/dist/tools/delete-knowledge-category.d.ts +12 -0
- package/dist/tools/delete-knowledge-category.d.ts.map +1 -0
- package/dist/tools/delete-knowledge-category.js +40 -0
- package/dist/tools/delete-knowledge-category.js.map +1 -0
- package/dist/tools/delete-knowledge-document.d.ts +12 -0
- package/dist/tools/delete-knowledge-document.d.ts.map +1 -0
- package/dist/tools/delete-knowledge-document.js +40 -0
- package/dist/tools/delete-knowledge-document.js.map +1 -0
- package/dist/tools/delete-recipe-step.d.ts +14 -0
- package/dist/tools/delete-recipe-step.d.ts.map +1 -0
- package/dist/tools/delete-recipe-step.js +65 -0
- package/dist/tools/delete-recipe-step.js.map +1 -0
- package/dist/tools/delete-recipe-store.d.ts +14 -0
- package/dist/tools/delete-recipe-store.d.ts.map +1 -0
- package/dist/tools/delete-recipe-store.js +65 -0
- package/dist/tools/delete-recipe-store.js.map +1 -0
- package/dist/tools/delete-recipe.d.ts +13 -0
- package/dist/tools/delete-recipe.d.ts.map +1 -0
- package/dist/tools/delete-recipe.js +59 -0
- package/dist/tools/delete-recipe.js.map +1 -0
- package/dist/tools/edit-app-code.d.ts +12 -0
- package/dist/tools/edit-app-code.d.ts.map +1 -0
- package/dist/tools/edit-app-code.js +110 -0
- package/dist/tools/edit-app-code.js.map +1 -0
- package/dist/tools/favorite-recipe.d.ts +13 -0
- package/dist/tools/favorite-recipe.d.ts.map +1 -0
- package/dist/tools/favorite-recipe.js +53 -0
- package/dist/tools/favorite-recipe.js.map +1 -0
- package/dist/tools/fork-recipe.d.ts +13 -0
- package/dist/tools/fork-recipe.d.ts.map +1 -0
- package/dist/tools/fork-recipe.js +56 -0
- package/dist/tools/fork-recipe.js.map +1 -0
- package/dist/tools/get-app-file.d.ts +11 -0
- package/dist/tools/get-app-file.d.ts.map +1 -0
- package/dist/tools/get-app-file.js +76 -0
- package/dist/tools/get-app-file.js.map +1 -0
- package/dist/tools/get-app-template.d.ts.map +1 -1
- package/dist/tools/get-app-template.js +65 -21
- package/dist/tools/get-app-template.js.map +1 -1
- package/dist/tools/get-app.js +54 -54
- package/dist/tools/get-knowledge-document.d.ts +12 -0
- package/dist/tools/get-knowledge-document.d.ts.map +1 -0
- package/dist/tools/get-knowledge-document.js +71 -0
- package/dist/tools/get-knowledge-document.js.map +1 -0
- package/dist/tools/get-knowledge-storage.d.ts +10 -0
- package/dist/tools/get-knowledge-storage.d.ts.map +1 -0
- package/dist/tools/get-knowledge-storage.js +54 -0
- package/dist/tools/get-knowledge-storage.js.map +1 -0
- package/dist/tools/get-recipe-definition.d.ts +15 -0
- package/dist/tools/get-recipe-definition.d.ts.map +1 -0
- package/dist/tools/get-recipe-definition.js +70 -0
- package/dist/tools/get-recipe-definition.js.map +1 -0
- package/dist/tools/get-recipe.d.ts +12 -0
- package/dist/tools/get-recipe.d.ts.map +1 -0
- package/dist/tools/get-recipe.js +88 -0
- package/dist/tools/get-recipe.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +301 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/insert-app-code.d.ts +12 -0
- package/dist/tools/insert-app-code.d.ts.map +1 -0
- package/dist/tools/insert-app-code.js +97 -0
- package/dist/tools/insert-app-code.js.map +1 -0
- package/dist/tools/link-app-workflow.js +21 -21
- package/dist/tools/link-recipe.d.ts +14 -0
- package/dist/tools/link-recipe.d.ts.map +1 -0
- package/dist/tools/link-recipe.js +76 -0
- package/dist/tools/link-recipe.js.map +1 -0
- package/dist/tools/list-app-files.d.ts +11 -0
- package/dist/tools/list-app-files.d.ts.map +1 -0
- package/dist/tools/list-app-files.js +84 -0
- package/dist/tools/list-app-files.js.map +1 -0
- package/dist/tools/list-apps.js +8 -8
- package/dist/tools/list-knowledge-categories.d.ts +14 -0
- package/dist/tools/list-knowledge-categories.d.ts.map +1 -0
- package/dist/tools/list-knowledge-categories.js +107 -0
- package/dist/tools/list-knowledge-categories.js.map +1 -0
- package/dist/tools/list-knowledge-documents.d.ts +15 -0
- package/dist/tools/list-knowledge-documents.d.ts.map +1 -0
- package/dist/tools/list-knowledge-documents.js +129 -0
- package/dist/tools/list-knowledge-documents.js.map +1 -0
- package/dist/tools/list-recipe-steps.d.ts +12 -0
- package/dist/tools/list-recipe-steps.d.ts.map +1 -0
- package/dist/tools/list-recipe-steps.js +69 -0
- package/dist/tools/list-recipe-steps.js.map +1 -0
- package/dist/tools/list-recipe-stores.d.ts +12 -0
- package/dist/tools/list-recipe-stores.d.ts.map +1 -0
- package/dist/tools/list-recipe-stores.js +87 -0
- package/dist/tools/list-recipe-stores.js.map +1 -0
- package/dist/tools/list-recipes.d.ts +12 -0
- package/dist/tools/list-recipes.d.ts.map +1 -0
- package/dist/tools/list-recipes.js +92 -0
- package/dist/tools/list-recipes.js.map +1 -0
- package/dist/tools/list-user-teams.d.ts +11 -0
- package/dist/tools/list-user-teams.d.ts.map +1 -0
- package/dist/tools/list-user-teams.js +56 -0
- package/dist/tools/list-user-teams.js.map +1 -0
- package/dist/tools/move-document-to-category.d.ts +13 -0
- package/dist/tools/move-document-to-category.d.ts.map +1 -0
- package/dist/tools/move-document-to-category.js +42 -0
- package/dist/tools/move-document-to-category.js.map +1 -0
- package/dist/tools/prepend-app-code.d.ts +12 -0
- package/dist/tools/prepend-app-code.d.ts.map +1 -0
- package/dist/tools/prepend-app-code.js +79 -0
- package/dist/tools/prepend-app-code.js.map +1 -0
- package/dist/tools/publish-app.js +7 -7
- package/dist/tools/query-knowledge-base.d.ts +18 -0
- package/dist/tools/query-knowledge-base.d.ts.map +1 -0
- package/dist/tools/query-knowledge-base.js +144 -0
- package/dist/tools/query-knowledge-base.js.map +1 -0
- package/dist/tools/rename-app-file.d.ts +11 -0
- package/dist/tools/rename-app-file.d.ts.map +1 -0
- package/dist/tools/rename-app-file.js +64 -0
- package/dist/tools/rename-app-file.js.map +1 -0
- package/dist/tools/reprocess-document.d.ts +12 -0
- package/dist/tools/reprocess-document.d.ts.map +1 -0
- package/dist/tools/reprocess-document.js +40 -0
- package/dist/tools/reprocess-document.js.map +1 -0
- package/dist/tools/search-apps.js +13 -13
- package/dist/tools/search.d.ts +14 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +86 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/set-app-entry-file.d.ts +11 -0
- package/dist/tools/set-app-entry-file.d.ts.map +1 -0
- package/dist/tools/set-app-entry-file.js +56 -0
- package/dist/tools/set-app-entry-file.js.map +1 -0
- package/dist/tools/transfer-document-ownership.d.ts +15 -0
- package/dist/tools/transfer-document-ownership.d.ts.map +1 -0
- package/dist/tools/transfer-document-ownership.js +66 -0
- package/dist/tools/transfer-document-ownership.js.map +1 -0
- package/dist/tools/unlink-app-workflow.js +2 -2
- package/dist/tools/unpublish-app.js +2 -2
- package/dist/tools/update-app-file.d.ts +11 -0
- package/dist/tools/update-app-file.d.ts.map +1 -0
- package/dist/tools/update-app-file.js +73 -0
- package/dist/tools/update-app-file.js.map +1 -0
- package/dist/tools/update-app.d.ts.map +1 -1
- package/dist/tools/update-app.js +8 -1
- package/dist/tools/update-app.js.map +1 -1
- package/dist/tools/update-knowledge-category.d.ts +15 -0
- package/dist/tools/update-knowledge-category.d.ts.map +1 -0
- package/dist/tools/update-knowledge-category.js +74 -0
- package/dist/tools/update-knowledge-category.js.map +1 -0
- package/dist/tools/update-recipe-step.d.ts +22 -0
- package/dist/tools/update-recipe-step.d.ts.map +1 -0
- package/dist/tools/update-recipe-step.js +97 -0
- package/dist/tools/update-recipe-step.js.map +1 -0
- package/dist/tools/update-recipe-store.d.ts +20 -0
- package/dist/tools/update-recipe-store.d.ts.map +1 -0
- package/dist/tools/update-recipe-store.js +98 -0
- package/dist/tools/update-recipe-store.js.map +1 -0
- package/dist/tools/update-recipe.d.ts +18 -0
- package/dist/tools/update-recipe.d.ts.map +1 -0
- package/dist/tools/update-recipe.js +98 -0
- package/dist/tools/update-recipe.js.map +1 -0
- package/dist/tools/upload-document-from-url.d.ts +16 -0
- package/dist/tools/upload-document-from-url.d.ts.map +1 -0
- package/dist/tools/upload-document-from-url.js +73 -0
- package/dist/tools/upload-document-from-url.js.map +1 -0
- package/dist/tools/upload-text-document.d.ts +17 -0
- package/dist/tools/upload-text-document.d.ts.map +1 -0
- package/dist/tools/upload-text-document.js +77 -0
- package/dist/tools/upload-text-document.js.map +1 -0
- package/dist/tools/vote-recipe.d.ts +13 -0
- package/dist/tools/vote-recipe.d.ts.map +1 -0
- package/dist/tools/vote-recipe.js +54 -0
- package/dist/tools/vote-recipe.js.map +1 -0
- package/dist/types.d.ts +3 -666
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/script-validator.d.ts.map +1 -1
- package/dist/utils/script-validator.js +5 -1
- package/dist/utils/script-validator.js.map +1 -1
- package/package.json +62 -54
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List Knowledge Documents Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists documents in the user's knowledge base with optional filtering.
|
|
5
|
+
* Includes both personal and team documents.
|
|
6
|
+
*/
|
|
7
|
+
export const listKnowledgeDocumentsToolDef = {
|
|
8
|
+
name: 'list_knowledge_documents',
|
|
9
|
+
description: 'List documents in your knowledge base. Optionally filter by category, team, or status. Shows document title, status, size, and chunk count. By default shows all accessible documents (personal and team).',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
category_id: {
|
|
14
|
+
type: 'number',
|
|
15
|
+
description: 'Filter documents by category ID (optional)',
|
|
16
|
+
},
|
|
17
|
+
team_id: {
|
|
18
|
+
type: ['number', 'string'],
|
|
19
|
+
description: 'Filter documents by team. Use a team ID (number) to show only that team\'s documents, or "personal" to show only personal documents. Use list_user_teams to see available teams.',
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
enum: ['pending', 'processing', 'ready', 'failed'],
|
|
24
|
+
description: 'Filter documents by processing status (optional)',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
required: [],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export async function handleListKnowledgeDocuments(api, args) {
|
|
31
|
+
try {
|
|
32
|
+
const documents = await api.listKnowledgeDocuments({
|
|
33
|
+
category_id: args.category_id,
|
|
34
|
+
team_id: args.team_id,
|
|
35
|
+
status: args.status,
|
|
36
|
+
});
|
|
37
|
+
if (documents.length === 0) {
|
|
38
|
+
let message = 'No documents found in your knowledge base.';
|
|
39
|
+
if (args.category_id || args.status || args.team_id) {
|
|
40
|
+
message += ' Try adjusting your filters.';
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
message += ' Use upload_text_document or upload_document_from_url to add documents.';
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
content: [{ type: 'text', text: message }],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const statusIcon = (status) => {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case 'ready':
|
|
52
|
+
return '✓';
|
|
53
|
+
case 'processing':
|
|
54
|
+
return '⏳';
|
|
55
|
+
case 'pending':
|
|
56
|
+
return '○';
|
|
57
|
+
case 'failed':
|
|
58
|
+
return '✗';
|
|
59
|
+
default:
|
|
60
|
+
return '?';
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
// Group documents by personal vs team
|
|
64
|
+
const personalDocs = documents.filter(d => !d.is_team_document);
|
|
65
|
+
const teamDocs = documents.filter(d => d.is_team_document);
|
|
66
|
+
const lines = [
|
|
67
|
+
`## Knowledge Base Documents (${documents.length} total)`,
|
|
68
|
+
'',
|
|
69
|
+
];
|
|
70
|
+
const formatDoc = (doc) => {
|
|
71
|
+
const docLines = [];
|
|
72
|
+
docLines.push(`### ${statusIcon(doc.status)} ${doc.title}`);
|
|
73
|
+
docLines.push(`- **ID:** ${doc.id} | **Hash:** ${doc.hash}`);
|
|
74
|
+
docLines.push(`- **Status:** ${doc.status}${doc.processing_error ? ` (Error: ${doc.processing_error})` : ''}`);
|
|
75
|
+
docLines.push(`- **Size:** ${doc.formatted_size} | **Chunks:** ${doc.chunk_count} | **Tokens:** ${doc.token_count}`);
|
|
76
|
+
docLines.push(`- **Type:** ${doc.mime_type}`);
|
|
77
|
+
if (doc.category) {
|
|
78
|
+
docLines.push(`- **Category:** ${doc.category.name}`);
|
|
79
|
+
}
|
|
80
|
+
if (doc.has_embeddings) {
|
|
81
|
+
docLines.push(`- **Embeddings:** Available`);
|
|
82
|
+
}
|
|
83
|
+
if (!doc.can_edit) {
|
|
84
|
+
docLines.push(`- **Access:** Read-only`);
|
|
85
|
+
}
|
|
86
|
+
docLines.push(`- **Created:** ${doc.created_at}`);
|
|
87
|
+
docLines.push('');
|
|
88
|
+
return docLines;
|
|
89
|
+
};
|
|
90
|
+
// Show personal documents if no team filter or explicitly 'personal'
|
|
91
|
+
if (personalDocs.length > 0 && (args.team_id === undefined || args.team_id === 'personal')) {
|
|
92
|
+
lines.push('### Personal Documents');
|
|
93
|
+
lines.push('');
|
|
94
|
+
for (const doc of personalDocs) {
|
|
95
|
+
lines.push(...formatDoc(doc));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Show team documents grouped by team
|
|
99
|
+
if (teamDocs.length > 0 && args.team_id !== 'personal') {
|
|
100
|
+
const byTeam = new Map();
|
|
101
|
+
for (const doc of teamDocs) {
|
|
102
|
+
const teamId = doc.team_id;
|
|
103
|
+
if (!byTeam.has(teamId)) {
|
|
104
|
+
byTeam.set(teamId, []);
|
|
105
|
+
}
|
|
106
|
+
byTeam.get(teamId).push(doc);
|
|
107
|
+
}
|
|
108
|
+
for (const [teamId, docs] of byTeam) {
|
|
109
|
+
const teamName = docs[0].team?.name || `Team ${teamId}`;
|
|
110
|
+
lines.push(`### Team: ${teamName} (ID: ${teamId})`);
|
|
111
|
+
lines.push('');
|
|
112
|
+
for (const doc of docs) {
|
|
113
|
+
lines.push(...formatDoc(doc));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: 'text', text: `Error listing documents: ${message}` }],
|
|
125
|
+
isError: true,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=list-knowledge-documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-knowledge-documents.js","sourceRoot":"","sources":["../../src/tools/list-knowledge-documents.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,6BAA6B,GAAS;IACjD,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,4MAA4M;IAC9M,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAC1B,WAAW,EAAE,kLAAkL;aA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G,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,QAAQ,MAAM,EAAE,CAAC;gBACxD,KAAK,CAAC,IAAI,CAAC,aAAa,QAAQ,SAAS,MAAM,GAAG,CAAC,CAAC;gBACpD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;oBACvB,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACpD,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,OAAO,EAAE,EAAE,CAAC;YACxE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipe_steps MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all steps in a recipe.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const listRecipeStepsTool: Tool;
|
|
9
|
+
export declare function handleListRecipeSteps(api: FlowDotApiClient, args: {
|
|
10
|
+
hash: string;
|
|
11
|
+
}): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=list-recipe-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-recipe-steps.d.ts","sourceRoot":"","sources":["../../src/tools/list-recipe-steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,mBAAmB,EAAE,IAajC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GACrB,OAAO,CAAC,cAAc,CAAC,CAmDzB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipe_steps MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all steps in a recipe.
|
|
5
|
+
*/
|
|
6
|
+
export const listRecipeStepsTool = {
|
|
7
|
+
name: 'list_recipe_steps',
|
|
8
|
+
description: 'List all steps in a recipe with their types, connections, and configurations.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
hash: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The recipe hash/ID',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['hash'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleListRecipeSteps(api, args) {
|
|
21
|
+
try {
|
|
22
|
+
const steps = await api.listRecipeSteps(args.hash);
|
|
23
|
+
if (steps.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'text',
|
|
28
|
+
text: 'No steps found in this recipe. Use `add_recipe_step` to add steps.',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Get recipe to check entry step
|
|
34
|
+
const recipe = await api.getRecipe(args.hash);
|
|
35
|
+
const entryStepId = recipe.entry_step_id;
|
|
36
|
+
const stepList = steps
|
|
37
|
+
.map((s) => {
|
|
38
|
+
const isEntry = s.id === entryStepId;
|
|
39
|
+
const entryMark = isEntry ? ' **[ENTRY]**' : '';
|
|
40
|
+
const desc = s.description ? ` - ${s.description}` : '';
|
|
41
|
+
const next = s.next ? `\n → next: ${s.next}` : '';
|
|
42
|
+
const onError = s.on_error ? `\n → on_error: ${s.on_error}` : '';
|
|
43
|
+
return `- **${s.name}** (${s.type})${entryMark}${desc}${next}${onError}
|
|
44
|
+
ID: ${s.id}`;
|
|
45
|
+
})
|
|
46
|
+
.join('\n\n');
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: `Recipe Steps (${steps.length}):\n\n${stepList}`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: 'text',
|
|
62
|
+
text: `Error listing steps: ${message}`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=list-recipe-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-recipe-steps.js","sourceRoot":"","sources":["../../src/tools/list-recipe-steps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,+EAA+E;IAC5F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;SACF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AAG,OAAO;UACpE,CAAC,CAAC,EAAE,EAAE,CAAC;QACX,CAAC,CAAC;aACD,IAAI,CAAC,MAAM,CAAC,CAAC;QAEhB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,iBAAiB,KAAK,CAAC,MAAM,SAAS,QAAQ,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,wBAAwB,OAAO,EAAE;iBACxC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipe_stores MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all stores in a recipe.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const listRecipeStoresTool: Tool;
|
|
9
|
+
export declare function handleListRecipeStores(api: FlowDotApiClient, args: {
|
|
10
|
+
hash: string;
|
|
11
|
+
}): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=list-recipe-stores.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-recipe-stores.d.ts","sourceRoot":"","sources":["../../src/tools/list-recipe-stores.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,EAAE,IAclC,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GACrB,OAAO,CAAC,cAAc,CAAC,CAwEzB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipe_stores MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all stores in a recipe.
|
|
5
|
+
*/
|
|
6
|
+
export const listRecipeStoresTool = {
|
|
7
|
+
name: 'list_recipe_stores',
|
|
8
|
+
description: 'List all stores (variables) in a recipe. Stores hold data that flows between steps.',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
hash: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
description: 'The recipe hash/ID',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['hash'],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function handleListRecipeStores(api, args) {
|
|
21
|
+
try {
|
|
22
|
+
const stores = await api.listRecipeStores(args.hash);
|
|
23
|
+
if (stores.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: 'text',
|
|
28
|
+
text: 'No stores found in this recipe. Use `add_recipe_store` to add stores.',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const inputStores = stores.filter((s) => s.is_input);
|
|
34
|
+
const outputStores = stores.filter((s) => s.is_output);
|
|
35
|
+
const internalStores = stores.filter((s) => !s.is_input && !s.is_output);
|
|
36
|
+
let text = `Recipe Stores (${stores.length} total):\n`;
|
|
37
|
+
if (inputStores.length > 0) {
|
|
38
|
+
text += `\n**Input Stores (${inputStores.length}):**\n`;
|
|
39
|
+
text += inputStores
|
|
40
|
+
.map((s) => {
|
|
41
|
+
const defaultVal = s.default_value !== undefined && s.default_value !== null
|
|
42
|
+
? ` = ${JSON.stringify(s.default_value)}`
|
|
43
|
+
: '';
|
|
44
|
+
return `- **${s.key}** (${s.schema_type})${defaultVal}${s.description ? ` - ${s.description}` : ''}\n ID: ${s.id}`;
|
|
45
|
+
})
|
|
46
|
+
.join('\n');
|
|
47
|
+
}
|
|
48
|
+
if (outputStores.length > 0) {
|
|
49
|
+
text += `\n\n**Output Stores (${outputStores.length}):**\n`;
|
|
50
|
+
text += outputStores
|
|
51
|
+
.map((s) => `- **${s.key}** (${s.schema_type})${s.description ? ` - ${s.description}` : ''}\n ID: ${s.id}`)
|
|
52
|
+
.join('\n');
|
|
53
|
+
}
|
|
54
|
+
if (internalStores.length > 0) {
|
|
55
|
+
text += `\n\n**Internal Stores (${internalStores.length}):**\n`;
|
|
56
|
+
text += internalStores
|
|
57
|
+
.map((s) => {
|
|
58
|
+
const defaultVal = s.default_value !== undefined && s.default_value !== null
|
|
59
|
+
? ` = ${JSON.stringify(s.default_value)}`
|
|
60
|
+
: '';
|
|
61
|
+
return `- **${s.key}** (${s.schema_type})${defaultVal}${s.description ? ` - ${s.description}` : ''}\n ID: ${s.id}`;
|
|
62
|
+
})
|
|
63
|
+
.join('\n');
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
content: [
|
|
67
|
+
{
|
|
68
|
+
type: 'text',
|
|
69
|
+
text,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
76
|
+
return {
|
|
77
|
+
content: [
|
|
78
|
+
{
|
|
79
|
+
type: 'text',
|
|
80
|
+
text: `Error listing stores: ${message}`,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
isError: true,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=list-recipe-stores.js.map
|
|
@@ -0,0 +1 @@
|
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,SAAS,IAAI,CAAC,CAAC,aAAa,KAAK,IAAI;oBAC1E,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;oBACzC,CAAC,CAAC,EAAE,CAAC;gBACP,OAAO,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,WAAW,IAAI,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC;YACxH,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yBAAyB,OAAO,EAAE;iBACzC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipes MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists agent recipes available to the user.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const listRecipesTool: Tool;
|
|
9
|
+
export declare function handleListRecipes(api: FlowDotApiClient, args: {
|
|
10
|
+
favorites_only?: boolean;
|
|
11
|
+
}): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=list-recipes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-recipes.d.ts","sourceRoot":"","sources":["../../src/tools/list-recipes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,IAmC7B,CAAC;AAEF,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GACjC,OAAO,CAAC,cAAc,CAAC,CAqDzB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_recipes MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists agent recipes available to the user.
|
|
5
|
+
*/
|
|
6
|
+
export const listRecipesTool = {
|
|
7
|
+
name: 'list_recipes',
|
|
8
|
+
description: `List agent recipes available to the user. Returns recipe IDs, names, descriptions, and step counts.
|
|
9
|
+
|
|
10
|
+
**What are Recipes?**
|
|
11
|
+
Recipes are reusable agent orchestration workflows. Design them with MCP tools, execute them via the FlowDot CLI.
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: MCP tools can only DESIGN recipes. To RUN a recipe, use the CLI:
|
|
14
|
+
\`npx flowdot recipes run <aliasOrHash> --input '{"key":"value"}'\`
|
|
15
|
+
|
|
16
|
+
**Building a Recipe (workflow):**
|
|
17
|
+
1. create_recipe → Creates recipe, returns hash
|
|
18
|
+
2. add_recipe_store → Define inputs (is_input: true) and outputs (is_output: true)
|
|
19
|
+
- **Name primary input store \`request\`** - CLI passes task as \`inputs.request\`
|
|
20
|
+
3. add_recipe_step → Add steps (agent, parallel, loop, gate, branch, invoke)
|
|
21
|
+
- For agent steps, use \`user_prompt\` (NOT \`prompt\`) in config
|
|
22
|
+
4. update_recipe_step → Connect steps via "next" and "on_error"
|
|
23
|
+
5. update_recipe → Set entry_step_id to the first step
|
|
24
|
+
6. link_recipe → Create CLI alias for easy execution
|
|
25
|
+
|
|
26
|
+
**Step Types:** agent (LLM with tools), parallel (concurrent), loop (iterate array), gate (approval), branch (conditional), invoke (subroutine)
|
|
27
|
+
|
|
28
|
+
**Interpolation Syntax:**
|
|
29
|
+
- \`{{inputs.request}}\` - Access CLI task argument
|
|
30
|
+
- \`{{store_key}}\` - Reference store values`,
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
favorites_only: {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
default: false,
|
|
37
|
+
description: 'Only return favorited recipes',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export async function handleListRecipes(api, args) {
|
|
43
|
+
try {
|
|
44
|
+
// listRecipes() now returns AgentRecipe[] directly (not wrapped in { recipes: [...] })
|
|
45
|
+
let recipes = await api.listRecipes();
|
|
46
|
+
// Filter favorites if requested
|
|
47
|
+
if (args.favorites_only) {
|
|
48
|
+
recipes = recipes.filter((r) => r.is_favorited);
|
|
49
|
+
}
|
|
50
|
+
if (recipes.length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: 'No recipes found. Create recipes to build reusable agent orchestration workflows.',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// Format as a readable list
|
|
61
|
+
const recipeList = recipes
|
|
62
|
+
.filter((r) => r && typeof r === 'object')
|
|
63
|
+
.map((r) => {
|
|
64
|
+
const desc = r.description ? ` - ${r.description}` : '';
|
|
65
|
+
const visibility = r.visibility === 'public' ? ' (public)' : r.visibility === 'unlisted' ? ' (unlisted)' : '';
|
|
66
|
+
const steps = r.step_count !== undefined ? ` [${r.step_count} steps]` : '';
|
|
67
|
+
return `- **${r.name}** (${r.hash})${visibility}${steps}${desc}`;
|
|
68
|
+
})
|
|
69
|
+
.join('\n');
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: `Found ${recipes.length} recipe(s):\n\n${recipeList}`,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: `Error listing recipes: ${message}`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
isError: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=list-recipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-recipes.js","sourceRoot":"","sources":["../../src/tools/list-recipes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;6CAsB8B;IAC3C,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,+BAA+B;aAC7C;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAqB,EACrB,IAAkC;IAElC,IAAI,CAAC;QACH,uFAAuF;QACvF,IAAI,OAAO,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;QAEtC,gCAAgC;QAChC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,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AK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,OAAO,EAAE;iBAC1C;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List User Teams Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all teams the user belongs to, including owned teams and member teams.
|
|
5
|
+
* Use this to discover available teams before filtering knowledge base operations.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
9
|
+
export declare const listUserTeamsToolDef: Tool;
|
|
10
|
+
export declare function handleListUserTeams(api: FlowDotApiClient): Promise<CallToolResult>;
|
|
11
|
+
//# sourceMappingURL=list-user-teams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-user-teams.d.ts","sourceRoot":"","sources":["../../src/tools/list-user-teams.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,EAAE,IASlC,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,cAAc,CAAC,CA2CzB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List User Teams Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists all teams the user belongs to, including owned teams and member teams.
|
|
5
|
+
* Use this to discover available teams before filtering knowledge base operations.
|
|
6
|
+
*/
|
|
7
|
+
export const listUserTeamsToolDef = {
|
|
8
|
+
name: 'list_user_teams',
|
|
9
|
+
description: 'List all teams you belong to. Use this to discover available teams before filtering knowledge base operations by team. Returns team ID, name, your role, and member count.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {},
|
|
13
|
+
required: [],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export async function handleListUserTeams(api) {
|
|
17
|
+
try {
|
|
18
|
+
const teams = await api.listUserTeams();
|
|
19
|
+
if (teams.length === 0) {
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: 'You are not a member of any teams. Your knowledge base contains only personal documents.',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const lines = [`## Your Teams (${teams.length})`, ''];
|
|
30
|
+
for (const team of teams) {
|
|
31
|
+
lines.push(`### ${team.name}`);
|
|
32
|
+
lines.push(`- **ID:** ${team.id}`);
|
|
33
|
+
lines.push(`- **Slug:** ${team.slug}`);
|
|
34
|
+
if (team.description) {
|
|
35
|
+
lines.push(`- **Description:** ${team.description}`);
|
|
36
|
+
}
|
|
37
|
+
lines.push(`- **Your Role:** ${team.role}`);
|
|
38
|
+
lines.push(`- **Members:** ${team.member_count}`);
|
|
39
|
+
lines.push(`- **Created:** ${team.created_at}`);
|
|
40
|
+
lines.push('');
|
|
41
|
+
}
|
|
42
|
+
lines.push('---');
|
|
43
|
+
lines.push('Use the team ID to filter knowledge base operations by team.');
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: 'text', text: lines.join('\n') }],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: 'text', text: `Error listing teams: ${message}` }],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=list-user-teams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-user-teams.js","sourceRoot":"","sources":["../../src/tools/list-user-teams.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACxC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,4KAA4K;IAC9K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAqB;IAErB,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAExC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,0FAA0F;qBACjG;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,kBAAkB,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC,CAAC;QAEtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,sBAAsB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YACvD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAE3E,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;SACpD,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,OAAO,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move Document to Category Tool
|
|
3
|
+
*
|
|
4
|
+
* Moves a document to a different category.
|
|
5
|
+
*/
|
|
6
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
8
|
+
export declare const moveDocumentToCategoryToolDef: Tool;
|
|
9
|
+
export declare function handleMoveDocumentToCategory(api: FlowDotApiClient, args: {
|
|
10
|
+
document_id: number;
|
|
11
|
+
category_id?: number | null;
|
|
12
|
+
}): Promise<CallToolResult>;
|
|
13
|
+
//# sourceMappingURL=move-document-to-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-document-to-category.d.ts","sourceRoot":"","sources":["../../src/tools/move-document-to-category.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,6BAA6B,EAAE,IAiB3C,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACzD,OAAO,CAAC,cAAc,CAAC,CAkBzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move Document to Category Tool
|
|
3
|
+
*
|
|
4
|
+
* Moves a document to a different category.
|
|
5
|
+
*/
|
|
6
|
+
export const moveDocumentToCategoryToolDef = {
|
|
7
|
+
name: 'move_document_to_category',
|
|
8
|
+
description: 'Move a document to a different category, or remove it from its current category (make it uncategorized).',
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
document_id: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The ID of the document to move',
|
|
15
|
+
},
|
|
16
|
+
category_id: {
|
|
17
|
+
type: ['number', 'null'],
|
|
18
|
+
description: 'The ID of the target category, or null to make the document uncategorized',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
required: ['document_id'],
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export async function handleMoveDocumentToCategory(api, args) {
|
|
25
|
+
try {
|
|
26
|
+
await api.moveDocumentToCategory(args.document_id, args.category_id ?? null);
|
|
27
|
+
const message = args.category_id
|
|
28
|
+
? `Document ${args.document_id} moved to category ${args.category_id}.`
|
|
29
|
+
: `Document ${args.document_id} is now uncategorized.`;
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: 'text', text: message }],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: 'text', text: `Error moving document: ${errorMessage}` }],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=move-document-to-category.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-document-to-category.js","sourceRoot":"","sources":["../../src/tools/move-document-to-category.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,6BAA6B,GAAS;IACjD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,0GAA0G;IACvH,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACxB,WAAW,EAAE,2EAA2E;aACzF;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,CAAC;KAC1B;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,GAAqB,EACrB,IAA0D;IAE1D,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,sBAAsB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW;YAC9B,CAAC,CAAC,YAAY,IAAI,CAAC,WAAW,sBAAsB,IAAI,CAAC,WAAW,GAAG;YACvE,CAAC,CAAC,YAAY,IAAI,CAAC,WAAW,wBAAwB,CAAC;QAEzD,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QAC9E,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,YAAY,EAAE,EAAE,CAAC;YAC3E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prepend_app_code Tool
|
|
3
|
+
*
|
|
4
|
+
* Prepends content to the beginning of app code.
|
|
5
|
+
* Use this to add constants, configuration, or setup code at the start.
|
|
6
|
+
* Required scope: apps:manage
|
|
7
|
+
*/
|
|
8
|
+
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import { FlowDotApiClient } from '../api-client.js';
|
|
10
|
+
export declare const prependAppCodeTool: Tool;
|
|
11
|
+
export declare function handlePrependAppCode(client: FlowDotApiClient, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
12
|
+
//# sourceMappingURL=prepend-app-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepend-app-code.d.ts","sourceRoot":"","sources":["../../src/tools/prepend-app-code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,kBAAkB,EAAE,IAuChC,CAAC;AAEF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAgCzB"}
|