Chrome DevTools for coding agents
docs: remove token estimates (#2003)
Alex Rudenko14938acd0897
diff --git a/docs/slim-tool-reference.md b/docs/slim-tool-reference.mdindex b149cc0a..46d06489 100644--- a/docs/slim-tool-reference.md+++ b/docs/slim-tool-reference.md@@ -1,6 +1,6 @@<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->-# Chrome DevTools MCP Slim Tool Reference (~359 cl100k_base tokens)+# Chrome DevTools MCP Slim Tool Reference- **[Navigation automation](#navigation-automation)** (1 tools)- [`navigate`](#navigate)diff --git a/docs/tool-reference.md b/docs/tool-reference.mdindex c3f6b1c0..58635928 100644--- a/docs/tool-reference.md+++ b/docs/tool-reference.md@@ -1,6 +1,6 @@<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->-# Chrome DevTools MCP Tool Reference (~7010 cl100k_base tokens)+# Chrome DevTools MCP Tool Reference- **[Input automation](#input-automation)** (10 tools)- [`click`](#click)diff --git a/package-lock.json b/package-lock.jsonindex 2dc03d1f..6e285091 100644--- a/package-lock.json+++ b/package-lock.json@@ -43,7 +43,6 @@"rollup-plugin-license": "^3.6.0","semver": "^7.7.4","sinon": "^21.0.0",- "tiktoken": "^1.0.22","typescript": "^6.0.2","typescript-eslint": "^8.43.0","urlpattern-polyfill": "^10.1.0",@@ -8660,13 +8659,6 @@"dev": true,"license": "MIT"},- "node_modules/tiktoken": {- "version": "1.0.22",- "resolved": "https://registry.npmjs.org/tiktoken/-/tiktoken-1.0.22.tgz",- "integrity": "sha512-PKvy1rVF1RibfF3JlXBSP0Jrcw2uq3yXdgcEXtKTYn3QJ/cBRBHDnrJ5jHky+MENZ6DIPwNUGWpkVx+7joCpNA==",- "dev": true,- "license": "MIT"- },"node_modules/tinyglobby": {"version": "0.2.15","resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",diff --git a/package.json b/package.jsonindex a998e4db..9c5a09b5 100644--- a/package.json+++ b/package.json@@ -77,7 +77,6 @@"rollup-plugin-license": "^3.6.0","semver": "^7.7.4","sinon": "^21.0.0",- "tiktoken": "^1.0.22","typescript": "^6.0.2","typescript-eslint": "^8.43.0","urlpattern-polyfill": "^10.1.0",diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.tsindex 3c05c265..77dc37b8 100644--- a/scripts/generate-docs.ts+++ b/scripts/generate-docs.ts@@ -6,10 +6,7 @@import fs from 'node:fs';-import {Client} from '@modelcontextprotocol/sdk/client/index.js';-import {StdioClientTransport} from '@modelcontextprotocol/sdk/client/stdio.js';import type {Tool} from '@modelcontextprotocol/sdk/types.js';-import {get_encoding} from 'tiktoken';import {cliOptions} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';import type {ParsedArguments} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';@@ -25,42 +22,6 @@ const OUTPUT_PATH = './docs/tool-reference.md';const SLIM_OUTPUT_PATH = './docs/slim-tool-reference.md';const README_PATH = './README.md';-async function measureServer(args: string[]) {- // 1. Connect to your actual MCP server- const transport = new StdioClientTransport({- command: 'node',- args: ['./build/src/bin/chrome-devtools-mcp.js', ...args], // Point to your built MCP server- });-- const client = new Client(- {name: 'measurer', version: '1.0.0'},- {capabilities: {}},- );- await client.connect(transport);-- // 2. Fetch all tools- const toolsList = await client.listTools();-- // 3. Serialize exactly how an LLM would see it (JSON)- const jsonString = JSON.stringify(toolsList.tools, null, 2);-- // 4. Count tokens (using cl100k_base which is standard for GPT-4/Claude-3.5 approximation)- const enc = get_encoding('cl100k_base');- const tokenCount = enc.encode(jsonString).length;-- console.log(`--- Measurement Results ---`);- console.log(`Total Tools: ${toolsList.tools.length}`);- console.log(`JSON Character Count: ${jsonString.length}`);- console.log(`Estimated Token Count: ~${tokenCount}`);-- // Clean up- enc.free();- await client.close();- return {- tokenCount,- };-}-// Extend the MCP Tool type to include our annotationsinterface ToolWithAnnotations extends Tool {annotations?: {@@ -337,14 +298,13 @@ async function generateReference(toolsWithAnnotations: ToolWithAnnotations[],categories: Record<string, ToolWithAnnotations[]>,sortedCategories: string[],- serverArgs: string[],) {console.log(`Found ${toolsWithAnnotations.length} tools`);// Generate markdown documentationlet markdown = `<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->-# ${title} (~${(await measureServer(serverArgs)).tokenCount} cl100k_base tokens)+# ${title}`;// Generate table of contents@@ -567,7 +527,6 @@ async function generateToolDocumentation(): Promise<void> {toolsWithAnnotations,categories,sortedCategories,- [],);// Generate tools TOC and update README@@ -584,7 +543,6 @@ async function generateToolDocumentation(): Promise<void> {toolsWithAnnotations,categories,sortedCategories,- ['--slim'],);}