Skip to content

Commit 0858b0b

Browse files
authored
further prompt refinement, discourage use of temp ids and encourage getting the widget tree often (#249)
1 parent 912c1f3 commit 0858b0b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkgs/dart_mcp_server/lib/src/mixins/dtd.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,11 @@ base mixin DartToolingDaemonSupport
662662
additionalProperties: true,
663663
description:
664664
'Command arguments are passed as additional properties to this map.'
665-
'To specify a widgets, you should first use the '
666-
'"${getWidgetTreeTool.name}" tool to inspect the widget tree for the '
667-
'value id of the widget and then use the "ByValueKey" finder type '
668-
'with that id.',
665+
'To specify a widget to interact with, you must first use the '
666+
'"${getWidgetTreeTool.name}" tool to get the widget tree of the '
667+
'current page so that you can see the available widgets. Do not '
668+
'guess at how to select widgets, use the real text, tooltips, and '
669+
'widget types that you see present in the tree.',
669670
properties: {
670671
'command': Schema.string(
671672
// Commented out values are flutter_driver commands that are not
@@ -706,7 +707,7 @@ base mixin DartToolingDaemonSupport
706707
'duration': Schema.string(
707708
description:
708709
'Required for the scroll command, the duration of the '
709-
'scrolling action in microseconds as a stringified integer.',
710+
'scrolling action in MICROSECONDS as a stringified integer.',
710711
),
711712
'dx': Schema.string(
712713
description:

pkgs/dart_mcp_server/lib/src/mixins/prompts.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ Perform the following tasks in order:
6868
widgets, but instead select them based on text, type, tooltip, etc. Avoid
6969
reading in files to accomplish this task, just inspect the live state of the
7070
app and widget tree. If you get stuck, feel free to ask the user for help.
71+
ALWAYS get the widget tree after performing any interaction, so you can see
72+
the updated state of the app.
7173
- If you are able to successfully complete the journey, then create a flutter
7274
driver based test with an appropriate name under the integration_test
7375
directory. The test should perform all the successful actions that you

0 commit comments

Comments
 (0)