Files
gh-ulasbilgen-mcp-skills-pl…/skills/mcp-chrome-devtools/scripts/get_network_request.js
2025-11-30 09:03:44 +08:00

36 lines
1.0 KiB
JavaScript
Executable File

#!/usr/bin/env node
/**
* MCP Server: chrome-devtools
* Server Version: 0.10.2
* Generated: 2025-11-23
* Tool: get_network_request
*
* Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.
*/
import { program } from 'commander';
import { callTool } from './mcp_client.js';
program
.name('get_network_request')
.description('Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel.')
.option('--reqid <value>', 'The reqid of the network request. If omitted returns the currently selected request in the DevTools Network panel.', parseFloat)
.parse();
const options = program.opts();
// Build arguments object
const args = {};
if (options.reqid !== undefined) {
args['reqid'] = options.reqid;
}
// Call the tool
try {
const result = await callTool('chrome-devtools', 'get_network_request', args);
console.log(result);
} catch (error) {
console.error('Error:', error.message);
process.exit(1);
}