Skip to content

Commit 643e222

Browse files
committed
fix: restore app lifecycle action semantics
1 parent e3bbd94 commit 643e222

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/tests/tools/llm-wording.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,13 @@ describe('LLM-facing MCP tool wording', () => {
130130
const tool = await registerTool('../../tools/app-management/app.js');
131131
const actionDescription = normalizeText(paramDescription(tool, 'action'));
132132

133-
expect(actionDescription).toMatch(/activate.*terminate.*is_installed.*clear.*require id or name/i);
133+
expect(actionDescription).toMatch(/activate.*foreground.*terminate.*stop.*is_installed.*check installation/i);
134+
expect(actionDescription).toMatch(/clear.*app data.*without uninstalling.*require id or name/i);
134135
expect(actionDescription).toMatch(/install.*requires path/i);
135136
expect(actionDescription).toMatch(/uninstall.*id\/name.*keepData/i);
136137
expect(actionDescription).toMatch(/list.*applicationType/i);
137138
expect(actionDescription).toMatch(/query_state.*0=not installed.*4=foreground.*id or name/i);
138-
expect(actionDescription).toMatch(/background.*default 5/i);
139+
expect(actionDescription).toMatch(/background.*foreground app.*background.*default 5/i);
139140
expect(actionDescription).toMatch(/deep_link.*requires url.*id\/name.*optional/i);
140141

141142
expect(normalizeText(paramDescription(tool, 'id'))).toMatch(

src/tools/app-management/app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ const schema = z.object({
3333
action: z
3434
.enum(APP_ACTIONS)
3535
.describe(
36-
'activate/terminate/is_installed/clear: require id or name. ' +
36+
'activate: foreground app; terminate: stop app; is_installed: check installation; ' +
37+
'clear: clear app data without uninstalling (all require id or name). ' +
3738
'install: requires path. uninstall: requires id/name; Android keepData is optional. ' +
3839
'list: optional iOS applicationType. ' +
3940
'query_state: get state 0=not installed,1=not running,2=background suspended,3=background,4=foreground (requires id or name). ' +
40-
'background: optional seconds (default 5). deep_link: requires url; id/name is optional.',
41+
'background: send foreground app to background; optional seconds (default 5). ' +
42+
'deep_link: requires url; id/name is optional.',
4143
),
4244
id: z.string().optional().describe('Android package or iOS bundle ID; takes precedence over name.'),
4345
name: z.string().optional().describe('Human-readable app name resolved to an ID; alternative to id.'),

0 commit comments

Comments
 (0)