@mcp-b/chrome-devtools-mcp 1.6.0 → 1.6.2
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.
|
@@ -168,7 +168,7 @@ export class WebMCPToolHub {
|
|
|
168
168
|
this.#logger(`⚠️ Warning: ${warning}`);
|
|
169
169
|
}
|
|
170
170
|
this.#logger(`Tracking WebMCP tool: ${toolId}`);
|
|
171
|
-
// Track tool metadata including
|
|
171
|
+
// Track tool metadata including schemas and annotations
|
|
172
172
|
this.#trackedTools.set(toolId, {
|
|
173
173
|
page,
|
|
174
174
|
originalName: tool.name,
|
|
@@ -176,6 +176,8 @@ export class WebMCPToolHub {
|
|
|
176
176
|
toolId,
|
|
177
177
|
description: tool.description || '',
|
|
178
178
|
inputSchema: tool.inputSchema,
|
|
179
|
+
outputSchema: tool.outputSchema,
|
|
180
|
+
annotations: tool.annotations,
|
|
179
181
|
});
|
|
180
182
|
// Track tool for this page
|
|
181
183
|
const pageToolSet = this.#pageTools.get(page) || new Set();
|
|
@@ -201,17 +203,29 @@ export class WebMCPToolHub {
|
|
|
201
203
|
return Array.from(this.#trackedTools.keys());
|
|
202
204
|
}
|
|
203
205
|
/**
|
|
204
|
-
* Get all tracked tools with their metadata
|
|
206
|
+
* Get all tracked tools with their metadata.
|
|
207
|
+
* Only returns tools from pages in the current session's window scope.
|
|
205
208
|
*/
|
|
206
209
|
getRegisteredTools() {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
const sessionPages = this.#context.getPages();
|
|
211
|
+
const result = [];
|
|
212
|
+
for (const rt of this.#trackedTools.values()) {
|
|
213
|
+
const pageIdx = sessionPages.indexOf(rt.page);
|
|
214
|
+
// Only include tools from pages in the session's window scope
|
|
215
|
+
if (pageIdx !== -1) {
|
|
216
|
+
result.push({
|
|
217
|
+
toolId: rt.toolId,
|
|
218
|
+
originalName: rt.originalName,
|
|
219
|
+
domain: rt.domain,
|
|
220
|
+
pageIdx,
|
|
221
|
+
description: rt.description,
|
|
222
|
+
inputSchema: rt.inputSchema,
|
|
223
|
+
outputSchema: rt.outputSchema,
|
|
224
|
+
annotations: rt.annotations,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return result;
|
|
215
229
|
}
|
|
216
230
|
/**
|
|
217
231
|
* Get a tracked tool by name and page.
|
|
@@ -195,14 +195,24 @@ export const listWebMCPTools = defineTool({
|
|
|
195
195
|
response.appendResponseLine(JSON.stringify({ tools: toolSummaries, count: tools.length }, null, 2));
|
|
196
196
|
}
|
|
197
197
|
else {
|
|
198
|
-
// Full output with schemas
|
|
199
|
-
const toolDefinitions = tools.map(tool =>
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
198
|
+
// Full output with schemas and annotations
|
|
199
|
+
const toolDefinitions = tools.map(tool => {
|
|
200
|
+
const def = {
|
|
201
|
+
name: tool.originalName,
|
|
202
|
+
description: tool.description,
|
|
203
|
+
inputSchema: tool.inputSchema,
|
|
204
|
+
pageIdx: tool.pageIdx,
|
|
205
|
+
domain: tool.domain,
|
|
206
|
+
};
|
|
207
|
+
// Only include optional fields if present
|
|
208
|
+
if (tool.outputSchema) {
|
|
209
|
+
def.outputSchema = tool.outputSchema;
|
|
210
|
+
}
|
|
211
|
+
if (tool.annotations) {
|
|
212
|
+
def.annotations = tool.annotations;
|
|
213
|
+
}
|
|
214
|
+
return def;
|
|
215
|
+
});
|
|
206
216
|
response.appendResponseLine(JSON.stringify({ tools: toolDefinitions, count: tools.length }, null, 2));
|
|
207
217
|
}
|
|
208
218
|
},
|