MCPcopy Create free account
hub / github.com/WebMCP-org/chrome-devtools-quickstart / main

Function main

benchmark/multi-step-benchmark.ts:233–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231// ============================================================
232
233async function main(): Promise<void> {
234 cli.header("Multi-Step Benchmark: Screenshots vs WebMCP Tools\nAgent SDK Version");
235
236 cli.info(`Calendar URL: ${CALENDAR_URL}`);
237 cli.info(`Runs per approach: ${NUM_RUNS}`);
238 cli.info("Using Claude Agent SDK for realistic agentic behavior");
239 cli.info("Screenshot approach: WebMCP tools blocked");
240 cli.info("WebMCP approach: All tools available, prefers semantic tools");
241
242 const screenshotResults: BenchmarkResult[] = [];
243 const webmcpResults: BenchmarkResult[] = [];
244
245 for (let i = 0; i < NUM_RUNS; i++) {
246 cli.section(`RUN ${i + 1}/${NUM_RUNS}`);
247
248 cli.info("Running Screenshot approach...");
249 const screenshotResult = await runScreenshotBenchmark();
250 screenshotResults.push(screenshotResult);
251 if (screenshotResult.success) {
252 cli.success(
253 `Completed: ${screenshotResult.inputTokens.toLocaleString()} in / ${screenshotResult.outputTokens.toLocaleString()} out, $${screenshotResult.totalCostUsd.toFixed(4)}`
254 );
255 } else {
256 cli.error("Failed");
257 }
258
259 cli.info("Running WebMCP approach...");
260 const webmcpResult = await runWebMCPBenchmark();
261 webmcpResults.push(webmcpResult);
262 if (webmcpResult.success) {
263 cli.success(
264 `Completed: ${webmcpResult.inputTokens.toLocaleString()} in / ${webmcpResult.outputTokens.toLocaleString()} out, $${webmcpResult.totalCostUsd.toFixed(4)}`
265 );
266 } else {
267 cli.error("Failed");
268 }
269 }
270
271 const screenshotAgg = aggregateBenchmarkResults("Screenshot", screenshotResults);
272 const webmcpAgg = aggregateBenchmarkResults("WebMCP", webmcpResults);
273
274 cli.section("SCREENSHOT APPROACH RESULTS");
275 printAgentApproachResults(screenshotAgg);
276
277 cli.section("WEBMCP APPROACH RESULTS");
278 printAgentApproachResults(webmcpAgg);
279
280 printAgentComparisonResults(screenshotAgg, webmcpAgg, "FINAL COMPARISON");
281 printAgentCostAnalysis(screenshotAgg, webmcpAgg);
282
283 cli.success("Benchmark complete");
284}
285
286main().catch((err) => {
287 cli.error(`${err}`);

Callers 1

Calls 6

printAgentCostAnalysisFunction · 0.85
runScreenshotBenchmarkFunction · 0.70
runWebMCPBenchmarkFunction · 0.70

Tested by

no test coverage detected