Skip to content

Commit e8d943b

Browse files
committed
chore: unify in page tools category convention
1 parent 1e45b75 commit e8d943b

5 files changed

Lines changed: 10 additions & 6 deletions

File tree

docs/tool-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ in the DevTools Elements panel (if any).
398398

399399
## Extensions
400400

401-
> NOTE: Extensions are not active by default. Use the '--category-extensions' flag
401+
> NOTE: Extensions are not active by default. Use the '--categoryExtensions' flag
402402
403403
### `install_extension`
404404

scripts/generate-docs.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {get_encoding} from 'tiktoken';
1313

1414
import {cliOptions} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';
1515
import type {ParsedArguments} from '../build/src/bin/chrome-devtools-mcp-cli-options.js';
16+
import {buildFlag} from '../build/src/index.js';
1617
import {
1718
ToolCategory,
1819
OFF_BY_DEFAULT_CATEGORIES,
@@ -356,7 +357,7 @@ async function generateReference(
356357
markdown += `## ${categoryName}\n\n`;
357358

358359
if (OFF_BY_DEFAULT_CATEGORIES.includes(category)) {
359-
const flagName = `--category-${category}`;
360+
const flagName = `--${buildFlag(category)}`;
360361

361362
markdown += `> NOTE: ${categoryName} are not active by default. Use the '${flagName}' flag\n\n`;
362363
}
@@ -446,6 +447,11 @@ function getToolsAndCategories(tools: any) {
446447
// Convert ToolDefinitions to ToolWithAnnotations
447448
const toolsWithAnnotations: ToolWithAnnotations[] = tools
448449
.filter(tool => {
450+
// Skipping in_page tools as they are not launched yet
451+
if (tool.annotations.category.includes('experimental')) {
452+
return false;
453+
}
454+
449455
if (!tool.annotations.conditions) {
450456
return true;
451457
}

src/tools/categories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export enum ToolCategory {
1212
NETWORK = 'network',
1313
DEBUGGING = 'debugging',
1414
EXTENSIONS = 'extensions',
15-
IN_PAGE = 'inPageTools',
15+
IN_PAGE = 'experimentalInPage',
1616
MEMORY = 'memory',
1717
}
1818

src/tools/inPage.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const listInPageTools = definePageTool({
4848
annotations: {
4949
category: ToolCategory.IN_PAGE,
5050
readOnlyHint: true,
51-
conditions: ['experimentalInPageTools'],
5251
},
5352
schema: {},
5453
handler: async (_request, response, _context) => {
@@ -62,7 +61,6 @@ export const executeInPageTool = definePageTool({
6261
annotations: {
6362
category: ToolCategory.IN_PAGE,
6463
readOnlyHint: false,
65-
conditions: ['experimentalInPageTools'],
6664
},
6765
schema: {
6866
toolName: zod.string().describe('The name of the tool to execute'),

tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('e2e', () => {
114114
);
115115
assert.ok(listInPageTools);
116116
},
117-
['--category-in-page-tools', '--experimental-in-page-tools'],
117+
['--category-experimental-in-page'],
118118
);
119119
});
120120

0 commit comments

Comments
 (0)