Skip to content

Commit 7a46ac4

Browse files
First pass at disabling tools that aren't useful for this MCP flow (microsoft#263298)
* First pass at disabling tools that aren't useful for this MCP flow And enable the multiplexer server * revert that * revert that * revert that * disable a couple more * add a start to improve model behavior & rewrite prompt file
1 parent ced2626 commit 7a46ac4

File tree

20 files changed

+1229
-1154
lines changed

20 files changed

+1229
-1154
lines changed
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
---
22
mode: agent
3-
description: 'Use playwright to _see_ the code changes you have made'
4-
tools: ['codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'openSimpleBrowser', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'todos', 'runTests', 'editFiles', 'runNotebooks', 'search', 'new', 'runCommands', 'runTasks', 'browser_click', 'browser_close', 'browser_console_messages', 'browser_drag', 'browser_evaluate', 'browser_file_upload', 'browser_handle_dialog', 'browser_hover', 'browser_network_requests', 'browser_press_key', 'browser_resize', 'browser_select_option', 'browser_snapshot', 'browser_tab_close', 'browser_tab_list', 'browser_tab_new', 'browser_tab_select', 'browser_take_screenshot', 'browser_type', 'browser_wait_for', 'get_commit', 'get_discussion', 'get_discussion_comments', 'get_issue', 'get_issue_comments']
3+
description: 'Use playwright & automation tools to _see_ the code changes you have made'
4+
tools: ['codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'openSimpleBrowser', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'todos', 'runTests', 'editFiles', 'runNotebooks', 'search', 'new', 'runCommands', 'runTasks', 'vscode-playwright-mcp', 'get_commit', 'get_discussion', 'get_discussion_comments', 'get_issue', 'get_issue_comments']
55
---
6-
For every UI change you make, verify the result interactively using vscode-playwright-mcp. Use Playwright to open the relevant UI, perform the change, and take screenshots to visually confirm the update. This ensures that every modification is visible, correct, and meets the intended requirements.
7-
8-
Always check your changes by running the UI in Playwright, capturing before-and-after screenshots, and reviewing them for accuracy. This approach helps catch regressions, improves reliability, and provides clear evidence of the effect of your work.
9-
10-
NOTE: When you use a playwright tool, it will automatically open a VS Code dev build so just assume that one will be opened for you. You do not need to open a dev build yourself.
11-
12-
In addition to visual verification, follow best practices for writing robust, maintainable, and extendable code. Ensure all user-facing messages are localized, use consistent naming and indentation, and prefer async/await for asynchronous operations. Write and update relevant tests, clean up temporary files, and adhere to project coding guidelines for quality and consistency.
13-
14-
If the task is unreasonable or infeasible, or if any of the tests are incorrect, please tell the user. The solution should be robust, maintainable, and extendable.
15-
16-
Tips for navigating VS Code:
17-
* When running a command in the command palette, the line needs to start with `>`
18-
* For Quick Pick bugs, you may need to temporarily modify an existing quick pick to see the issue.
6+
You are being requested to visually confirm the code changes you are making using vscode-playwright-mcp.
7+
8+
You MUST run vscode_automation_start & browser_snapshot.
9+
You MUST verify the bad behavior you are investigating using vscode-playwright-mcp.
10+
You MUST verify the code changes you have made using vscode-playwright-mcp.
11+
You MUST take before and after screenshots.
12+
Remember, you are NOT writing playwright tests; instead, focus on using the tools to validate and explore the changes.
13+
You MAY need to make multiple passes, iterating between making code changes and verifying them with the tools.
14+
You MUST reload the window (`Developer: Reload Window` command) after making changes to ensure they are applied correctly.
15+
You MAY make temporary changes to the code to facilitate testing and exploration. For example, using the quick pick in the Configure Display Language action as a scratch pad to add buttons to it.

test/mcp/src/automationTools/activityBar.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55

66
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
77
import { Application } from '../../../automation';
8-
import { z } from 'zod';
98

109
/**
1110
* Activity Bar Tools
1211
*/
1312
export function applyActivityBarTools(server: McpServer, app: Application) {
14-
server.tool(
15-
'vscode_automation_activitybar_wait_for_position',
16-
'Wait for the activity bar to appear at a specific position',
17-
{
18-
position: z.enum(['LEFT', 'RIGHT']).describe('Position of the activity bar (LEFT or RIGHT)')
19-
},
20-
async (args) => {
21-
const { position } = args;
22-
const activityBarPosition = position === 'LEFT' ? 0 : 1; // ActivityBarPosition.LEFT = 0, RIGHT = 1
23-
await app.workbench.activitybar.waitForActivityBar(activityBarPosition);
24-
return {
25-
content: [{
26-
type: 'text' as const,
27-
text: `Activity bar found at position: ${position}`
28-
}]
29-
};
30-
}
31-
);
13+
// Doesn't seem particularly useful
14+
// server.tool(
15+
// 'vscode_automation_activitybar_wait_for_position',
16+
// 'Wait for the activity bar to appear at a specific position',
17+
// {
18+
// position: z.enum(['LEFT', 'RIGHT']).describe('Position of the activity bar (LEFT or RIGHT)')
19+
// },
20+
// async (args) => {
21+
// const { position } = args;
22+
// const activityBarPosition = position === 'LEFT' ? 0 : 1; // ActivityBarPosition.LEFT = 0, RIGHT = 1
23+
// await app.workbench.activitybar.waitForActivityBar(activityBarPosition);
24+
// return {
25+
// content: [{
26+
// type: 'text' as const,
27+
// text: `Activity bar found at position: ${position}`
28+
// }]
29+
// };
30+
// }
31+
// );
3232
}

test/mcp/src/automationTools/core.ts

Lines changed: 142 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -5,145 +5,165 @@
55

66
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
77
import { Application } from '../../../automation';
8-
import { z } from 'zod';
98

109
/**
1110
* Core Application Management Tools
1211
*/
1312
export function applyCoreTools(server: McpServer, app: Application) {
13+
// A dummy start tool just so that the model has something to hold on to.
1414
server.tool(
15-
'vscode_automation_restart',
16-
'Restart VS Code with optional workspace or folder and extra arguments',
17-
{
18-
workspaceOrFolder: z.string().optional().describe('Optional path to workspace or folder to open'),
19-
extraArgs: z.array(z.string()).optional().describe('Optional extra command line arguments')
20-
},
21-
async (args) => {
22-
const { workspaceOrFolder, extraArgs } = args;
23-
await app.restart({ workspaceOrFolder, extraArgs });
24-
return {
25-
content: [{
26-
type: 'text' as const,
27-
text: `VS Code restarted successfully${workspaceOrFolder ? ` with workspace: ${workspaceOrFolder}` : ''}`
28-
}]
29-
};
30-
}
31-
);
32-
33-
server.tool(
34-
'vscode_automation_stop',
35-
'Stop the VS Code application',
15+
'vscode_automation_start',
16+
'Start VS Code Build',
17+
{},
3618
async () => {
37-
await app.stop();
3819
return {
3920
content: [{
4021
type: 'text' as const,
41-
text: 'VS Code stopped successfully'
22+
text: `VS Code started successfully`
4223
}]
4324
};
4425
}
4526
);
27+
// Playwright keeps using this as a start... maybe it needs some massaging
28+
// server.tool(
29+
// 'vscode_automation_restart',
30+
// 'Restart VS Code with optional workspace or folder and extra arguments',
31+
// {
32+
// workspaceOrFolder: z.string().optional().describe('Optional path to workspace or folder to open'),
33+
// extraArgs: z.array(z.string()).optional().describe('Optional extra command line arguments')
34+
// },
35+
// async (args) => {
36+
// const { workspaceOrFolder, extraArgs } = args;
37+
// await app.restart({ workspaceOrFolder, extraArgs });
38+
// return {
39+
// content: [{
40+
// type: 'text' as const,
41+
// text: `VS Code restarted successfully${workspaceOrFolder ? ` with workspace: ${workspaceOrFolder}` : ''}`
42+
// }]
43+
// };
44+
// }
45+
// );
4646

47-
server.tool(
48-
'vscode_automation_get_quality',
49-
'Get the quality/build type of VS Code (Dev, Insiders, Stable, etc.)',
50-
async () => {
51-
const info = {
52-
quality: app.quality,
53-
remote: app.remote,
54-
web: app.web,
55-
workspacePathOrFolder: app.workspacePathOrFolder,
56-
extensionsPath: app.extensionsPath,
57-
userDataPath: app.userDataPath
58-
};
59-
return {
60-
content: [{
61-
type: 'text' as const,
62-
text: `VS Code Info:\n${JSON.stringify(info, null, 2)}`
63-
}]
64-
};
65-
}
66-
);
47+
// I don't think Playwright needs this
48+
// server.tool(
49+
// 'vscode_automation_stop',
50+
// 'Stop the VS Code application',
51+
// async () => {
52+
// await app.stop();
53+
// return {
54+
// content: [{
55+
// type: 'text' as const,
56+
// text: 'VS Code stopped successfully'
57+
// }]
58+
// };
59+
// }
60+
// );
6761

68-
server.tool(
69-
'vscode_automation_wait_for_element',
70-
'Wait for a UI element to appear using CSS selector - prefer using specific workbench methods when available',
71-
{
72-
selector: z.string().describe('CSS selector for the element to wait for'),
73-
timeout: z.number().optional().default(20).describe('Timeout in seconds (default: 20)')
74-
},
75-
async (args) => {
76-
const { selector, timeout = 20 } = args;
77-
const retryCount = Math.floor((timeout * 1000) / 100); // 100ms intervals
78-
const element = await app.code.waitForElement(selector, undefined, retryCount);
79-
return {
80-
content: [{
81-
type: 'text' as const,
82-
text: `Element found: ${selector} (${!!element ? 'success' : 'not found'})`
83-
}]
84-
};
85-
}
86-
);
62+
// This doesn't seem particularly useful
63+
// server.tool(
64+
// 'vscode_automation_get_quality',
65+
// 'Get the quality/build type of VS Code (Dev, Insiders, Stable, etc.)',
66+
// async () => {
67+
// const info = {
68+
// quality: app.quality,
69+
// remote: app.remote,
70+
// web: app.web,
71+
// workspacePathOrFolder: app.workspacePathOrFolder,
72+
// extensionsPath: app.extensionsPath,
73+
// userDataPath: app.userDataPath
74+
// };
75+
// return {
76+
// content: [{
77+
// type: 'text' as const,
78+
// text: `VS Code Info:\n${JSON.stringify(info, null, 2)}`
79+
// }]
80+
// };
81+
// }
82+
// );
8783

88-
server.tool(
89-
'vscode_automation_click_element',
90-
'Click on a UI element - prefer using specific workbench methods when available',
91-
{
92-
selector: z.string().describe('CSS selector for the element to click'),
93-
xOffset: z.number().optional().describe('Optional X offset from element center'),
94-
yOffset: z.number().optional().describe('Optional Y offset from element center')
95-
},
96-
async (args) => {
97-
const { selector, xOffset, yOffset } = args;
98-
await app.code.waitAndClick(selector, xOffset, yOffset);
99-
return {
100-
content: [{
101-
type: 'text' as const,
102-
text: `Clicked element: ${selector}${xOffset !== undefined ? ` (offset: ${xOffset}, ${yOffset})` : ''}`
103-
}]
104-
};
105-
}
106-
);
84+
// This doesn't seem particularly useful
85+
// server.tool(
86+
// 'vscode_automation_wait_for_element',
87+
// 'Wait for a UI element to appear using CSS selector - prefer using specific workbench methods when available',
88+
// {
89+
// selector: z.string().describe('CSS selector for the element to wait for'),
90+
// timeout: z.number().optional().default(20).describe('Timeout in seconds (default: 20)')
91+
// },
92+
// async (args) => {
93+
// const { selector, timeout = 20 } = args;
94+
// const retryCount = Math.floor((timeout * 1000) / 100); // 100ms intervals
95+
// const element = await app.code.waitForElement(selector, undefined, retryCount);
96+
// return {
97+
// content: [{
98+
// type: 'text' as const,
99+
// text: `Element found: ${selector} (${!!element ? 'success' : 'not found'})`
100+
// }]
101+
// };
102+
// }
103+
// );
107104

108-
server.tool(
109-
'vscode_automation_send_keybinding',
110-
'Send a keybinding to VS Code (e.g., ctrl+shift+p, cmd+s)',
111-
{
112-
keybinding: z.string().describe('The keybinding to send (e.g., ctrl+shift+p, cmd+s, escape)'),
113-
waitSelector: z.string().optional().describe('Optional CSS selector to wait for after sending the keybinding')
114-
},
115-
async (args) => {
116-
const { keybinding, waitSelector } = args;
117-
await app.code.dispatchKeybinding(keybinding, async () => {
118-
if (waitSelector) {
119-
await app.code.waitForElement(waitSelector);
120-
}
121-
});
122-
return {
123-
content: [{
124-
type: 'text' as const,
125-
text: `Sent keybinding: ${keybinding}${waitSelector ? ` (waited for: ${waitSelector})` : ''}`
126-
}]
127-
};
128-
}
129-
);
105+
// Defer to Playwright's tool
106+
// server.tool(
107+
// 'vscode_automation_click_element',
108+
// 'Click on a UI element - prefer using specific workbench methods when available',
109+
// {
110+
// selector: z.string().describe('CSS selector for the element to click'),
111+
// xOffset: z.number().optional().describe('Optional X offset from element center'),
112+
// yOffset: z.number().optional().describe('Optional Y offset from element center')
113+
// },
114+
// async (args) => {
115+
// const { selector, xOffset, yOffset } = args;
116+
// await app.code.waitAndClick(selector, xOffset, yOffset);
117+
// return {
118+
// content: [{
119+
// type: 'text' as const,
120+
// text: `Clicked element: ${selector}${xOffset !== undefined ? ` (offset: ${xOffset}, ${yOffset})` : ''}`
121+
// }]
122+
// };
123+
// }
124+
// );
130125

131-
server.tool(
132-
'vscode_automation_get_text_content',
133-
'Get text content from a UI element using CSS selector',
134-
{
135-
selector: z.string().describe('CSS selector for the element'),
136-
expectedText: z.string().optional().describe('Optional expected text to wait for')
137-
},
138-
async (args) => {
139-
const { selector, expectedText } = args;
140-
const text = await app.code.waitForTextContent(selector, expectedText);
141-
return {
142-
content: [{
143-
type: 'text' as const,
144-
text: `Text content from ${selector}: "${text}"`
145-
}]
146-
};
147-
}
148-
);
126+
// Defer to Playwright's tool
127+
// server.tool(
128+
// 'vscode_automation_send_keybinding',
129+
// 'Send a keybinding to VS Code (e.g., ctrl+shift+p, cmd+s)',
130+
// {
131+
// keybinding: z.string().describe('The keybinding to send (e.g., ctrl+shift+p, cmd+s, escape)'),
132+
// waitSelector: z.string().optional().describe('Optional CSS selector to wait for after sending the keybinding')
133+
// },
134+
// async (args) => {
135+
// const { keybinding, waitSelector } = args;
136+
// await app.code.dispatchKeybinding(keybinding, async () => {
137+
// if (waitSelector) {
138+
// await app.code.waitForElement(waitSelector);
139+
// }
140+
// });
141+
// return {
142+
// content: [{
143+
// type: 'text' as const,
144+
// text: `Sent keybinding: ${keybinding}${waitSelector ? ` (waited for: ${waitSelector})` : ''}`
145+
// }]
146+
// };
147+
// }
148+
// );
149+
150+
// Defer to Playwright's tool
151+
// server.tool(
152+
// 'vscode_automation_get_text_content',
153+
// 'Get text content from a UI element using CSS selector',
154+
// {
155+
// selector: z.string().describe('CSS selector for the element'),
156+
// expectedText: z.string().optional().describe('Optional expected text to wait for')
157+
// },
158+
// async (args) => {
159+
// const { selector, expectedText } = args;
160+
// const text = await app.code.waitForTextContent(selector, expectedText);
161+
// return {
162+
// content: [{
163+
// type: 'text' as const,
164+
// text: `Text content from ${selector}: "${text}"`
165+
// }]
166+
// };
167+
// }
168+
// );
149169
}

0 commit comments

Comments
 (0)