secondbrainos-mcp-server 1.5.0 → 1.5.1
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/build/index.js +11 -15
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -318,25 +318,21 @@ class SecondBrainOSServer {
|
|
|
318
318
|
}
|
|
319
319
|
// Otherwise treat as a workflow prompt
|
|
320
320
|
const workflowId = this.workflowNameToId.get(promptName) || promptName;
|
|
321
|
-
//
|
|
321
|
+
// Single call — list response now includes prompt metadata per workflow
|
|
322
322
|
const workflowsData = await this.callRunPromptChain('', '');
|
|
323
323
|
const workflowMeta = (workflowsData.workflows || []).find((wf) => wf.workflow_id === workflowId);
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
if (promptIds.length === 0) {
|
|
324
|
+
const prompts = workflowMeta?.prompts || [];
|
|
325
|
+
if (prompts.length === 0) {
|
|
327
326
|
throw new McpError(ErrorCode.InvalidRequest, `No prompts found for workflow: ${workflowId}`);
|
|
328
327
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
}));
|
|
339
|
-
const sortedPrompts = promptResults.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
328
|
+
const sortedPrompts = prompts
|
|
329
|
+
.map((p) => ({
|
|
330
|
+
id: p.prompt_id,
|
|
331
|
+
name: p.name || '',
|
|
332
|
+
order: p.order || 0,
|
|
333
|
+
description: p.description || ''
|
|
334
|
+
}))
|
|
335
|
+
.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
340
336
|
const workflowDocument = {
|
|
341
337
|
skill_id: workflowId,
|
|
342
338
|
name: workflowMeta?.name || promptName,
|