Skip to content

Commit a277dec

Browse files
author
Tomohiko Hiraki
committed
Shorten and clarify schema descriptions in tools
1 parent bc70486 commit a277dec

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/tools/keyboard.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const pressKey = defineTabTool({
1313
title: 'Press a key',
1414
description: 'Press a key on the keyboard',
1515
inputSchema: z.object({
16-
key: z
17-
.string()
18-
.describe('Key to press (e.g., Enter, Escape, ArrowLeft, a)'),
16+
key: z.string().describe('Key to press'),
1917
expectation: expectationSchema.describe(
2018
'Page state config. Use batch_execute for multiple keys'
2119
),
@@ -44,9 +42,9 @@ const typeSchema = elementSchema.extend({
4442
ref: z
4543
.string()
4644
.describe(
47-
'System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
45+
'System-generated element ID from previous tool results. Never use custom values.'
4846
),
49-
text: z.string().describe('Text to type into the element'),
47+
text: z.string(),
5048
submit: z.boolean().optional().describe('Press Enter after typing if true'),
5149
slowly: z
5250
.boolean()

src/tools/snapshot.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const elementSchema = z.object({
4545
ref: z
4646
.string()
4747
.describe(
48-
'System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
48+
'System-generated element ID from previous tool results. Never use custom values.'
4949
),
5050
});
5151

@@ -110,7 +110,7 @@ const drag = defineTabTool({
110110
startRef: z
111111
.string()
112112
.describe(
113-
'System-generated source element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
113+
'System-generated source element ID from previous tool results. Never use custom values.'
114114
),
115115
endElement: z
116116
.string()
@@ -120,7 +120,7 @@ const drag = defineTabTool({
120120
endRef: z
121121
.string()
122122
.describe(
123-
'System-generated target element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'
123+
'System-generated target element ID from previous tool results. Never use custom values.'
124124
),
125125
expectation: expectationSchema.describe(
126126
'Page state after drag. Use batch_execute for workflows'

src/tools/wait.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const wait = defineTool({
1111
'Wait for text to appear or disappear or a specified time to pass',
1212
inputSchema: z.object({
1313
time: z.number().optional().describe('Wait time in seconds'),
14-
text: z.string().optional().describe('Text to wait for'),
15-
textGone: z.string().optional().describe('Text to wait to disappear'),
14+
text: z.string().optional(),
15+
textGone: z.string().optional(),
1616
expectation: expectationSchema.describe('Page state after wait'),
1717
}),
1818
type: 'readOnly',

0 commit comments

Comments
 (0)