outline-mcp-server 5.6.0 → 5.6.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.
|
@@ -35,15 +35,27 @@ toolRegistry.register('list_documents', {
|
|
|
35
35
|
limit: args.limit || 25,
|
|
36
36
|
sort: args.sort || 'updatedAt',
|
|
37
37
|
direction: args.direction || 'DESC',
|
|
38
|
-
collectionId: args.collectionId || '',
|
|
39
|
-
userId: args.userId || '',
|
|
40
|
-
backlinkDocumentId: args.backlinkDocumentId || '',
|
|
41
|
-
parentDocumentId: args.parentDocumentId || '',
|
|
42
38
|
};
|
|
43
39
|
// Only add template if it's explicitly defined
|
|
44
40
|
if (args.template !== undefined) {
|
|
45
41
|
payload.template = args.template;
|
|
46
42
|
}
|
|
43
|
+
// Only add collectionId if it's provided
|
|
44
|
+
if (args.collectionId) {
|
|
45
|
+
payload.collectionId = args.collectionId;
|
|
46
|
+
}
|
|
47
|
+
// Only add userId if it's provided
|
|
48
|
+
if (args.userId) {
|
|
49
|
+
payload.userId = args.userId;
|
|
50
|
+
}
|
|
51
|
+
// Only add backlinkDocumentId if it's provided
|
|
52
|
+
if (args.backlinkDocumentId) {
|
|
53
|
+
payload.backlinkDocumentId = args.backlinkDocumentId;
|
|
54
|
+
}
|
|
55
|
+
// Only add parentDocumentId if it's provided
|
|
56
|
+
if (args.parentDocumentId) {
|
|
57
|
+
payload.parentDocumentId = args.parentDocumentId;
|
|
58
|
+
}
|
|
47
59
|
// Only add query if it's provided
|
|
48
60
|
if (args.query) {
|
|
49
61
|
payload.query = args.query;
|
|
@@ -7,10 +7,12 @@ export async function getMcpServer() {
|
|
|
7
7
|
version: process.env.npm_package_version || 'unknown',
|
|
8
8
|
description: 'Outline Model Context Protocol server',
|
|
9
9
|
});
|
|
10
|
-
await loadAllTools(tool =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
await loadAllTools((tool) => {
|
|
11
|
+
server.registerTool(tool.name, {
|
|
12
|
+
description: tool.description,
|
|
13
|
+
inputSchema: tool.inputSchema,
|
|
14
|
+
outputSchema: tool.outputSchema,
|
|
15
|
+
}, tool.callback);
|
|
16
|
+
});
|
|
15
17
|
return server;
|
|
16
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
4
4
|
import toolRegistry from './toolRegistry.js';
|
|
5
5
|
/**
|
|
6
6
|
* Dynamically imports all tool files from the tools directory
|
|
@@ -14,10 +14,12 @@ export async function loadAllTools(onToolLoaded) {
|
|
|
14
14
|
const toolFiles = fs
|
|
15
15
|
.readdirSync(toolsDir)
|
|
16
16
|
.filter(file => file.endsWith('.ts') || file.endsWith('.js'));
|
|
17
|
-
// Import all tool files, causing them to be
|
|
17
|
+
// Import all tool files, causing them to be registered via `registerTool`
|
|
18
18
|
for (const file of toolFiles) {
|
|
19
19
|
const resolved = path.resolve(toolsDir, file);
|
|
20
|
-
|
|
20
|
+
// Convert path to file:// URL for cross-platform ESM compatibility
|
|
21
|
+
const fileURL = pathToFileURL(resolved).href;
|
|
22
|
+
await import(fileURL);
|
|
21
23
|
}
|
|
22
24
|
// configure McpServer with all definitions
|
|
23
25
|
for (const tool of toolRegistry.tools) {
|