@mcp-b/chrome-devtools-mcp 1.6.0 → 1.6.1
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.
|
@@ -201,17 +201,27 @@ export class WebMCPToolHub {
|
|
|
201
201
|
return Array.from(this.#trackedTools.keys());
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
204
|
-
* Get all tracked tools with their metadata
|
|
204
|
+
* Get all tracked tools with their metadata.
|
|
205
|
+
* Only returns tools from pages in the current session's window scope.
|
|
205
206
|
*/
|
|
206
207
|
getRegisteredTools() {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
208
|
+
const sessionPages = this.#context.getPages();
|
|
209
|
+
const result = [];
|
|
210
|
+
for (const rt of this.#trackedTools.values()) {
|
|
211
|
+
const pageIdx = sessionPages.indexOf(rt.page);
|
|
212
|
+
// Only include tools from pages in the session's window scope
|
|
213
|
+
if (pageIdx !== -1) {
|
|
214
|
+
result.push({
|
|
215
|
+
toolId: rt.toolId,
|
|
216
|
+
originalName: rt.originalName,
|
|
217
|
+
domain: rt.domain,
|
|
218
|
+
pageIdx,
|
|
219
|
+
description: rt.description,
|
|
220
|
+
inputSchema: rt.inputSchema,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return result;
|
|
215
225
|
}
|
|
216
226
|
/**
|
|
217
227
|
* Get a tracked tool by name and page.
|