@hypothesi/tauri-mcp-server 0.3.0 → 0.3.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.
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
|
|
38
38
|
if (element) {
|
|
39
39
|
const outerHTML = element.outerHTML;
|
|
40
|
-
// Truncate long HTML to avoid overwhelming output
|
|
41
|
-
const truncated = outerHTML.length >
|
|
42
|
-
? outerHTML.substring(0,
|
|
40
|
+
// Truncate very long HTML to avoid overwhelming output
|
|
41
|
+
const truncated = outerHTML.length > 5000
|
|
42
|
+
? outerHTML.substring(0, 5000) + '...'
|
|
43
43
|
: outerHTML;
|
|
44
44
|
return 'Found element: ' + truncated;
|
|
45
45
|
}
|
|
@@ -56,7 +56,9 @@ export const GetStylesSchema = WindowTargetSchema.extend({
|
|
|
56
56
|
.describe('Whether to get styles for all matching elements (true) or just the first (false)'),
|
|
57
57
|
});
|
|
58
58
|
export const ExecuteJavaScriptSchema = WindowTargetSchema.extend({
|
|
59
|
-
script: z.string().describe('JavaScript code to execute in the webview context'
|
|
59
|
+
script: z.string().describe('JavaScript code to execute in the webview context. ' +
|
|
60
|
+
'If returning a value, it must be JSON-serializable. ' +
|
|
61
|
+
'For functions that return values, use IIFE syntax: "(() => { return value; })()" not "() => { return value; }"'),
|
|
60
62
|
args: z.array(z.unknown()).optional().describe('Arguments to pass to the script'),
|
|
61
63
|
});
|
|
62
64
|
export const FocusElementSchema = WindowTargetSchema.extend({
|
package/dist/tools-registry.js
CHANGED
|
@@ -228,6 +228,8 @@ export const TOOLS = [
|
|
|
228
228
|
name: 'tauri_webview_execute_js',
|
|
229
229
|
description: '[Tauri Apps Only] Execute JavaScript in a Tauri app\'s webview context. ' +
|
|
230
230
|
'Requires active tauri_driver_session. Has access to window.__TAURI__. ' +
|
|
231
|
+
'If you need a return value, it must be JSON-serializable. ' +
|
|
232
|
+
'For functions that return values, use an IIFE: "(() => { return 5; })()" not "() => { return 5; }". ' +
|
|
231
233
|
'For browser JS execution, use Chrome DevTools MCP instead.',
|
|
232
234
|
category: TOOL_CATEGORIES.UI_AUTOMATION,
|
|
233
235
|
schema: ExecuteJavaScriptSchema,
|