GET /api/health/errors

Get Health Errors

Query the persistent error log for recent errors. Supports pagination with limit and text search filtering.

Overview

Returns recent entries from the persistent error log at ~/.mudabbir/health/errors.jsonl. Errors are stored across sessions and survive page refresh and server restart.

Results are returned newest-first. Use the search parameter to filter errors by text content across the message, source, and traceback fields.

Query Parameters

limit integer

Maximum number of error entries to return.

search string

Optional text filter. Searches across message, source, and traceback fields (case-insensitive).

Response

Returns an array of error entries. Each entry is an object with:

id string

12-character hex error ID (e.g. a1b2c3d4e5f6).

timestamp string

ISO 8601 UTC timestamp of when the error was recorded.

source string

Where the error originated. Common values: agent_loop, deep_work, tool_execution, unknown.

severity string

Error severity: error or warning.

message string

Human-readable error description.

traceback string

Python traceback string, if available. Empty string if no traceback was captured.

context object

Additional metadata. Contents vary by error source — may include session_id, backend, tool_name, etc.

Terminal window
# Get last 10 errors
curl -X GET "http://localhost:8888/api/health/errors?limit=10"
# Search for API-related errors
curl -X GET "http://localhost:8888/api/health/errors?search=api&limit=5"
// Get recent errors
const response = await fetch("http://localhost:8888/api/health/errors?limit=10");
const errors = await response.json();
// Search for specific errors
const filtered = await fetch(
"http://localhost:8888/api/health/errors?search=timeout&limit=5"
);
const results = await filtered.json();
import requests
# Get recent errors
response = requests.get(
"http://localhost:8888/api/health/errors",
params={"limit": 10}
)
errors = response.json()
# Search for specific errors
response = requests.get(
"http://localhost:8888/api/health/errors",
params={"search": "anthropic", "limit": 5}
)
[
{
"id": "a1b2c3d4e5f6",
"timestamp": "2025-03-15T10:30:00+00:00",
"source": "agent_loop",
"severity": "error",
"message": "Anthropic API returned 401: Invalid API key",
"traceback": "Traceback (most recent call last):\n File \"agent/loop.py\", line 142\n ...\nanthropic.AuthenticationError: Invalid API key",
"context": {
"session_id": "abc123",
"backend": "claude_agent_sdk"
}
},
{
"id": "f6e5d4c3b2a1",
"timestamp": "2025-03-15T10:25:00+00:00",
"source": "deep_work",
"severity": "error",
"message": "Task execution failed: connection timed out",
"traceback": "",
"context": {
"project_id": "proj_001",
"task_index": 3
}
}
]
Request
curl -X GET "http://localhost:8888/api/health/errors" \
  -H "Content-Type: application/json"
const response = await fetch("http://localhost:8888/api/health/errors", {
  method: "GET",
  headers: {
    "Content-Type": "application/json"
},
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
    "http://localhost:8888/api/health/errors",
    headers={'Content-Type':'application/json'},
)

print(response.json())
package main

import (
    "fmt"
    "net/http"
    "io"
)

func main() {
    req, _ := http.NewRequest("GET", "http://localhost:8888/api/health/errors", nil)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
Response
Send a request to see the response