From 0cd62ee06d64477684454f8ff77c6888709ba8b4 Mon Sep 17 00:00:00 2001 From: Jake MacDonald Date: Mon, 28 Jul 2025 13:13:59 -0700 Subject: [PATCH 1/2] further prompt refinement, discourage use of temp ids and encourage getting the widget tree often --- pkgs/dart_mcp_server/lib/src/mixins/dtd.dart | 9 +++++---- pkgs/dart_mcp_server/lib/src/mixins/prompts.dart | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart b/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart index 3b799685..6a427540 100644 --- a/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart +++ b/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart @@ -662,10 +662,11 @@ base mixin DartToolingDaemonSupport additionalProperties: true, description: 'Command arguments are passed as additional properties to this map.' - 'To specify a widgets, you should first use the ' - '"${getWidgetTreeTool.name}" tool to inspect the widget tree for the ' - 'value id of the widget and then use the "ByValueKey" finder type ' - 'with that id.', + 'To specify a widget to interact with, you must first use the ' + '"${getWidgetTreeTool.name}" tool to get the widget tree of the ' + 'current page so that you can see the available widgets. Do not ' + 'guess at how to select widgets, use the real text, tooltips, and ' + 'widget types that you see present in the tree.', properties: { 'command': Schema.string( // Commented out values are flutter_driver commands that are not diff --git a/pkgs/dart_mcp_server/lib/src/mixins/prompts.dart b/pkgs/dart_mcp_server/lib/src/mixins/prompts.dart index 5914a45a..ed092cba 100644 --- a/pkgs/dart_mcp_server/lib/src/mixins/prompts.dart +++ b/pkgs/dart_mcp_server/lib/src/mixins/prompts.dart @@ -68,6 +68,8 @@ Perform the following tasks in order: widgets, but instead select them based on text, type, tooltip, etc. Avoid reading in files to accomplish this task, just inspect the live state of the app and widget tree. If you get stuck, feel free to ask the user for help. + ALWAYS get the widget tree after performing any interaction, so you can see + the updated state of the app. - If you are able to successfully complete the journey, then create a flutter driver based test with an appropriate name under the integration_test directory. The test should perform all the successful actions that you From b18b17115c0b5be3e373909dc58ba83f242e3661 Mon Sep 17 00:00:00 2001 From: Jake MacDonald Date: Mon, 28 Jul 2025 13:32:25 -0700 Subject: [PATCH 2/2] emphasize microseconds vs milliseconds for the duration --- pkgs/dart_mcp_server/lib/src/mixins/dtd.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart b/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart index 6a427540..044af1a2 100644 --- a/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart +++ b/pkgs/dart_mcp_server/lib/src/mixins/dtd.dart @@ -707,7 +707,7 @@ base mixin DartToolingDaemonSupport 'duration': Schema.string( description: 'Required for the scroll command, the duration of the ' - 'scrolling action in microseconds as a stringified integer.', + 'scrolling action in MICROSECONDS as a stringified integer.', ), 'dx': Schema.string( description: