Canonical Definition
{
"function": {
"description": "Read recent PM2 error or output logs for a specific service. Use this to investigate why a service crashed, see runtime errors, or trace application-level issues. Much more detailed than read_os_logs which only reads the centralized log file.",
"name": "read_pm2_logs",
"parameters": {
"properties": {
"lines": {
"description": "Number of recent lines to return. Defaults to 50, max 200.",
"type": "integer"
},
"log_type": {
"description": "Which log stream to read. 'error' for stderr, 'output' for stdout, 'both' for combined. Defaults to 'error'.",
"enum": [
"error",
"output",
"both"
],
"type": "string"
},
"search": {
"description": "Optional text to search/filter within the log lines.",
"type": "string"
},
"service_name": {
"description": "PM2 process name to read logs for (e.g., 'vetra-rust', 'cartera-rust', 'movilo', 'sentinel', 'hera-core').",
"type": "string"
}
},
"required": [
"service_name"
],
"type": "object"
}
},
"type": "function"
}