Skip to content

Commit bc68a81

Browse files
committed
Update system prompt for dynamic tool discovery
Also fix issue where `dynamic_tools` was exposed even in static tool mode.
1 parent 57f4714 commit bc68a81

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/mcp/tools/discovery/discover_tools.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,9 @@ The user wants to perform the following task: "${sanitizedTaskDescription}"
175175
IMPORTANT: Select EXACTLY ONE workflow that best matches the user's task. In most cases, users are working with a project or workspace. Use this selection guide:
176176
177177
Primary (project/workspace-based) workflows:
178-
- iOS simulator with .xcworkspace: choose "simulator-workspace"
179-
- iOS simulator with .xcodeproj: choose "simulator-project"
180-
- iOS physical device with .xcworkspace: choose "device-workspace"
181-
- iOS physical device with .xcodeproj: choose "device-project"
182-
- macOS with .xcworkspace: choose "macos-workspace"
183-
- macOS with .xcodeproj: choose "macos-project"
178+
- iOS simulator (supports both .xcworkspace and .xcodeproj): choose "simulator"
179+
- iOS physical device (supports both .xcworkspace and .xcodeproj): choose "device"
180+
- macOS (supports both .xcworkspace and .xcodeproj): choose "macos"
184181
- Swift Package Manager (no Xcode project): choose "swift-package"
185182
186183
Secondary (task-based, no project/workspace needed):
@@ -189,11 +186,13 @@ Secondary (task-based, no project/workspace needed):
189186
- UI automation/gestures/screenshots on a simulator app: choose "ui-testing"
190187
- System/environment diagnostics or validation: choose "doctor"
191188
- Create new iOS/macOS projects from templates: choose "project-scaffolding"
189+
- Project discovery and analysis: choose "project-discovery"
190+
- General utilities: choose "utilities"
192191
193192
All available workflows:
194193
${workflowDescriptions}
195194
196-
Respond with ONLY a JSON array containing ONE workflow name that best matches the task (e.g., ["simulator-workspace"]).`;
195+
Respond with ONLY a JSON array containing ONE workflow name that best matches the task (e.g., ["simulator"]).`;
197196

198197
// 4. Send sampling request with configurable parameters
199198
const llmConfig = getLLMConfig();

src/utils/tool-registry.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ export async function registerAllToolsStatic(server: McpServer): Promise<void> {
191191
const allTools = [];
192192

193193
for (const plugin of plugins.values()) {
194+
// Exclude discovery tools in static mode - they should only be available in dynamic mode
195+
if (plugin.name === 'discover_tools') {
196+
continue;
197+
}
198+
194199
allTools.push({
195200
name: plugin.name,
196201
config: {

0 commit comments

Comments
 (0)