run_operational_mode_command
Execute operational commands on Palo Alto firewalls to retrieve system status, monitor performance, and troubleshoot network security devices.
Instructions
Run an operational mode command on the Palo Alto firewall
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | Command to run |
Implementation Reference
- src/index.ts:236-265 (handler)Handler for the 'run_operational_mode_command' tool. Extracts the 'command' from arguments, sends a POST request to the Palo Alto API /Device/Op endpoint with the command, and returns the JSON response or throws an error.case 'run_operational_mode_command': { const { command } = request.params.arguments as { command: string }; try { const response = await axios.post( `${API_BASE_URL}/Device/Op`, { command }, { headers: { 'X-PAN-KEY': API_KEY, 'Accept': 'application/json' } } ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { const axiosError = error as AxiosError; throw new McpError( ErrorCode.InternalError, `Palo Alto API error: ${axiosError.message}` ); } }
- src/index.ts:74-87 (registration)Registration of the 'run_operational_mode_command' tool in the ListTools response, including name, description, and input schema.{ name: 'run_operational_mode_command', description: 'Run an operational mode command on the Palo Alto firewall', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'Command to run' } }, required: ['command'] }, }
- src/index.ts:77-85 (schema)Input schema for the 'run_operational_mode_command' tool, defining the required 'command' string parameter.inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'Command to run' } }, required: ['command']