@monocle.sh/studio 0.2.0 → 0.2.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/dist/mcp/tools/index.js +8 -2
- package/package.json +1 -1
package/dist/mcp/tools/index.js
CHANGED
|
@@ -5,6 +5,13 @@ import { listErrorsTool } from "./list_errors.js";
|
|
|
5
5
|
import { listQueriesTool } from "./list_queries.js";
|
|
6
6
|
import { clearDataTool } from "./clear_data.js";
|
|
7
7
|
//#region src/mcp/tools/index.ts
|
|
8
|
+
/**
|
|
9
|
+
* JSON.stringify with BigInt support.
|
|
10
|
+
* DuckDB returns BigInt for nanosecond timestamps, which native JSON.stringify cannot handle.
|
|
11
|
+
*/
|
|
12
|
+
function safeStringify(value) {
|
|
13
|
+
return JSON.stringify(value, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
|
|
14
|
+
}
|
|
8
15
|
const tools = [
|
|
9
16
|
listTracesTool,
|
|
10
17
|
getTraceTool,
|
|
@@ -26,10 +33,9 @@ function registerAllTools(server) {
|
|
|
26
33
|
idempotentHint: true
|
|
27
34
|
}
|
|
28
35
|
}, async (params) => {
|
|
29
|
-
const result = await tool.execute(params);
|
|
30
36
|
return { content: [{
|
|
31
37
|
type: "text",
|
|
32
|
-
text:
|
|
38
|
+
text: safeStringify(await tool.execute(params))
|
|
33
39
|
}] };
|
|
34
40
|
});
|
|
35
41
|
}
|