@eddym06/custom-chrome-mcp 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONDITIONAL_DESCRIPTIONS.md +174 -0
- package/FUTURE_FEATURES.txt +1503 -0
- package/README.md +300 -3
- package/TEST_WORKFLOW.md +311 -0
- package/USAGE_GUIDE.md +393 -0
- package/demo_features.ts +115 -0
- package/dist/chrome-connector.d.ts +31 -4
- package/dist/chrome-connector.d.ts.map +1 -1
- package/dist/chrome-connector.js +402 -53
- package/dist/chrome-connector.js.map +1 -1
- package/dist/index.js +69 -12
- package/dist/index.js.map +1 -1
- package/dist/tests/execute-script-tests.d.ts +62 -0
- package/dist/tests/execute-script-tests.d.ts.map +1 -0
- package/dist/tests/execute-script-tests.js +280 -0
- package/dist/tests/execute-script-tests.js.map +1 -0
- package/dist/tests/run-execute-tests.d.ts +7 -0
- package/dist/tests/run-execute-tests.d.ts.map +1 -0
- package/dist/tests/run-execute-tests.js +88 -0
- package/dist/tests/run-execute-tests.js.map +1 -0
- package/dist/tools/advanced-network.backup.d.ts +245 -0
- package/dist/tools/advanced-network.backup.d.ts.map +1 -0
- package/dist/tools/advanced-network.backup.js +996 -0
- package/dist/tools/advanced-network.backup.js.map +1 -0
- package/dist/tools/advanced-network.d.ts +580 -0
- package/dist/tools/advanced-network.d.ts.map +1 -0
- package/dist/tools/advanced-network.js +1325 -0
- package/dist/tools/advanced-network.js.map +1 -0
- package/dist/tools/anti-detection.d.ts.map +1 -1
- package/dist/tools/anti-detection.js +13 -8
- package/dist/tools/anti-detection.js.map +1 -1
- package/dist/tools/capture.d.ts +15 -9
- package/dist/tools/capture.d.ts.map +1 -1
- package/dist/tools/capture.js +21 -12
- package/dist/tools/capture.js.map +1 -1
- package/dist/tools/interaction.d.ts +84 -10
- package/dist/tools/interaction.d.ts.map +1 -1
- package/dist/tools/interaction.js +88 -33
- package/dist/tools/interaction.js.map +1 -1
- package/dist/tools/navigation.d.ts.map +1 -1
- package/dist/tools/navigation.js +43 -21
- package/dist/tools/navigation.js.map +1 -1
- package/dist/tools/network-accessibility.d.ts +67 -0
- package/dist/tools/network-accessibility.d.ts.map +1 -0
- package/dist/tools/network-accessibility.js +367 -0
- package/dist/tools/network-accessibility.js.map +1 -0
- package/dist/tools/playwright-launcher.d.ts +1 -1
- package/dist/tools/playwright-launcher.js +6 -6
- package/dist/tools/playwright-launcher.js.map +1 -1
- package/dist/tools/service-worker.d.ts +2 -2
- package/dist/tools/service-worker.d.ts.map +1 -1
- package/dist/tools/service-worker.js +22 -12
- package/dist/tools/service-worker.js.map +1 -1
- package/dist/tools/session.d.ts.map +1 -1
- package/dist/tools/session.js +23 -14
- package/dist/tools/session.js.map +1 -1
- package/dist/tools/system.d.ts +2 -2
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +9 -5
- package/dist/tools/system.js.map +1 -1
- package/dist/utils/truncate.d.ts +29 -0
- package/dist/utils/truncate.d.ts.map +1 -0
- package/dist/utils/truncate.js +46 -0
- package/dist/utils/truncate.js.map +1 -0
- package/dist/verify-tools.d.ts +7 -0
- package/dist/verify-tools.d.ts.map +1 -0
- package/dist/verify-tools.js +137 -0
- package/dist/verify-tools.js.map +1 -0
- package/package.json +3 -3
- package/recordings/demo_recording.har +3036 -0
- package/.npmrc.example +0 -2
- package/test-playwright.js +0 -57
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Conditional Description Patterns for All Tools
|
|
2
|
+
|
|
3
|
+
## Philosophy: "When to Use" > "What it Does"
|
|
4
|
+
|
|
5
|
+
AI models make better tool selection decisions when descriptions focus on **triggers** and **context** rather than just functionality.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Pattern Templates
|
|
10
|
+
|
|
11
|
+
### Pattern 1: Navigation Tools
|
|
12
|
+
```
|
|
13
|
+
[Tool Name] - [Primary Action]
|
|
14
|
+
|
|
15
|
+
USE THIS WHEN:
|
|
16
|
+
- User says "[trigger phrase 1]"
|
|
17
|
+
- User says "[trigger phrase 2]"
|
|
18
|
+
- [Contextual condition]
|
|
19
|
+
|
|
20
|
+
WORKFLOW:
|
|
21
|
+
1️⃣ [This tool] → 2️⃣ [Next logical step] → 3️⃣ [Then action]
|
|
22
|
+
|
|
23
|
+
❌ DO NOT USE when [anti-pattern]
|
|
24
|
+
✅ USE when [correct pattern]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Pattern 2: Interaction Tools
|
|
28
|
+
```
|
|
29
|
+
[Tool Name] - [Primary Action]
|
|
30
|
+
|
|
31
|
+
⚠️ PREREQUISITE: [Required step before this tool]
|
|
32
|
+
|
|
33
|
+
USE THIS WHEN:
|
|
34
|
+
- [User intent 1]
|
|
35
|
+
- [User intent 2]
|
|
36
|
+
|
|
37
|
+
PROPER WORKFLOW:
|
|
38
|
+
1️⃣ [Analysis step] → 2️⃣ [This tool] → 3️⃣ [Verification]
|
|
39
|
+
|
|
40
|
+
COMMON MISTAKE: [What AI typically gets wrong]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Pattern 3: Analysis/Inspection Tools
|
|
44
|
+
```
|
|
45
|
+
[Tool Name] - [Primary Action]
|
|
46
|
+
|
|
47
|
+
🔍 USE THIS WHEN:
|
|
48
|
+
- [Symptom 1] (e.g., "content missing after click")
|
|
49
|
+
- [Symptom 2] (e.g., "page loads but data empty")
|
|
50
|
+
- [Symptom 3]
|
|
51
|
+
|
|
52
|
+
WHY CRITICAL: [Explains the "why" - what's invisible without this tool]
|
|
53
|
+
|
|
54
|
+
WHEN NOT TO USE: [Situations where simpler tool suffices]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Pattern 4: Network/Debugging Tools
|
|
58
|
+
```
|
|
59
|
+
[Tool Name] - [Primary Action]
|
|
60
|
+
|
|
61
|
+
🚨 USE THIS WHEN:
|
|
62
|
+
- After [action], expected [result] doesn't appear
|
|
63
|
+
- Suspecting [technical condition]
|
|
64
|
+
- Need to [specific diagnostic]
|
|
65
|
+
|
|
66
|
+
WORKFLOW STEP: [X] of [Y]
|
|
67
|
+
PREVIOUS: [What should have been done before]
|
|
68
|
+
NEXT: [What to do after]
|
|
69
|
+
|
|
70
|
+
TROUBLESHOOTING: If [problem], this tool reveals [hidden information]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Pattern 5: Configuration/Setup Tools
|
|
74
|
+
```
|
|
75
|
+
[Tool Name] - [Primary Action]
|
|
76
|
+
|
|
77
|
+
⚙️ CONFIGURE BEFORE: [Type of operation]
|
|
78
|
+
|
|
79
|
+
PARAMETERS AI SHOULD SET:
|
|
80
|
+
- [param1]: [guidance on value selection]
|
|
81
|
+
- [param2]: [guidance on value selection]
|
|
82
|
+
|
|
83
|
+
TYPICAL VALUES:
|
|
84
|
+
- Simple operations: [value]
|
|
85
|
+
- Complex operations: [value]
|
|
86
|
+
- Heavy operations: [value]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Application Strategy
|
|
92
|
+
|
|
93
|
+
### Phase 1: Critical Path Tools (HIGH PRIORITY)
|
|
94
|
+
Tools that are most commonly used and most likely to be misused:
|
|
95
|
+
- ✅ navigate (DONE)
|
|
96
|
+
- ✅ create_tab (DONE)
|
|
97
|
+
- ✅ click (DONE)
|
|
98
|
+
- ✅ type (DONE)
|
|
99
|
+
- ✅ get_html (DONE)
|
|
100
|
+
- ✅ screenshot (DONE)
|
|
101
|
+
- ✅ execute_script (DONE)
|
|
102
|
+
- ✅ enable_response_interception (DONE)
|
|
103
|
+
- ✅ list_intercepted_responses (DONE)
|
|
104
|
+
|
|
105
|
+
### Phase 2: Analysis & Debugging (MEDIUM PRIORITY)
|
|
106
|
+
- get_text
|
|
107
|
+
- get_attribute
|
|
108
|
+
- wait_for_selector
|
|
109
|
+
- list_tabs
|
|
110
|
+
- get_url
|
|
111
|
+
- get_cookies
|
|
112
|
+
- list_all_targets
|
|
113
|
+
- connect_to_target
|
|
114
|
+
- execute_in_target
|
|
115
|
+
|
|
116
|
+
### Phase 3: Advanced Network (MEDIUM PRIORITY)
|
|
117
|
+
- modify_intercepted_response (partially done)
|
|
118
|
+
- create_mock_endpoint
|
|
119
|
+
- enable_websocket_interception
|
|
120
|
+
- start_har_recording
|
|
121
|
+
- export_har_file
|
|
122
|
+
- inject_css_global
|
|
123
|
+
- inject_js_global
|
|
124
|
+
|
|
125
|
+
### Phase 4: Specialized Tools (LOWER PRIORITY)
|
|
126
|
+
- Anti-detection tools
|
|
127
|
+
- Service worker tools
|
|
128
|
+
- Session management
|
|
129
|
+
- Print to PDF
|
|
130
|
+
- Storage tools
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Key Principles
|
|
135
|
+
|
|
136
|
+
1. **Start with "WHEN"**: What triggers using this tool?
|
|
137
|
+
2. **Explain "WHY"**: What's invisible/unclear without it?
|
|
138
|
+
3. **Show "HOW"**: What's the workflow?
|
|
139
|
+
4. **Warn against anti-patterns**: What mistakes do AIs make?
|
|
140
|
+
5. **Guide parameters**: What values should AI choose?
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Examples Applied
|
|
145
|
+
|
|
146
|
+
### Before (generic):
|
|
147
|
+
```typescript
|
|
148
|
+
name: 'get_cookies',
|
|
149
|
+
description: 'Get all cookies for the current domain'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### After (conditional):
|
|
153
|
+
```typescript
|
|
154
|
+
name: 'get_cookies',
|
|
155
|
+
description: `🔍 Retrieves browser cookies for current domain.
|
|
156
|
+
|
|
157
|
+
USE THIS WHEN:
|
|
158
|
+
- Debugging authentication issues (checking if auth token exists)
|
|
159
|
+
- Session not persisting (verify session cookies)
|
|
160
|
+
- Login appears successful but features unavailable (check cookie values)
|
|
161
|
+
- Need to verify third-party cookies loaded
|
|
162
|
+
|
|
163
|
+
WHY: Cookies often contain hidden auth/session data not visible in HTML.
|
|
164
|
+
Many login/auth issues are cookie-related (expired, wrong domain, httpOnly).
|
|
165
|
+
|
|
166
|
+
COMMON ISSUES DIAGNOSED:
|
|
167
|
+
- "User logged in but still see login page" → Check auth cookie
|
|
168
|
+
- "Cart items disappear" → Check session cookie
|
|
169
|
+
- "Preferences not saving" → Check settings cookie`
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
This pattern should be applied to ALL 84+ tools systematically.
|