Initial commit
This commit is contained in:
41
skills/mcp-chrome-devtools/scripts/fill_form.js
Executable file
41
skills/mcp-chrome-devtools/scripts/fill_form.js
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* MCP Server: chrome-devtools
|
||||
* Server Version: 0.10.2
|
||||
* Generated: 2025-11-23
|
||||
* Tool: fill_form
|
||||
*
|
||||
* Fill out multiple form elements at once
|
||||
*/
|
||||
|
||||
import { program } from 'commander';
|
||||
import { callTool } from './mcp_client.js';
|
||||
|
||||
program
|
||||
.name('fill_form')
|
||||
.description('Fill out multiple form elements at once')
|
||||
.option('--elements <items...>', 'Elements from snapshot to fill out. (required)')
|
||||
.parse();
|
||||
|
||||
const options = program.opts();
|
||||
|
||||
// Validate required options
|
||||
if (!options.elements) {
|
||||
console.error('Error: --elements is required');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Build arguments object
|
||||
const args = {};
|
||||
if (options.elements !== undefined) {
|
||||
args['elements'] = options.elements;
|
||||
}
|
||||
|
||||
// Call the tool
|
||||
try {
|
||||
const result = await callTool('chrome-devtools', 'fill_form', args);
|
||||
console.log(result);
|
||||
} catch (error) {
|
||||
console.error('Error:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user