This commit is contained in:
larssand
2026-06-30 12:46:09 +02:00
parent e781f66003
commit 86065eca59
8 changed files with 58 additions and 8 deletions

View File

@@ -70,7 +70,19 @@ class GraylogAggregateSource:
self.query = query or "*"
def fetch_count(self, *, range_seconds: int = 300) -> dict[str, object]:
status = self.client.probe()
try:
status = self.client.probe()
except RuntimeError as exc:
return {
"status": "error",
"source": "graylog_mcp_aggregate",
"aggregate_status": "error",
"aggregate_events": 0,
"aggregate_records": 0,
"aggregate_error": f"probe_error: {exc}",
"aggregate_errors": [f"probe_error: {exc}"],
"aggregate_schema_properties": [],
}
tool_schemas = status.get("tool_schemas", {}) if isinstance(status.get("tool_schemas"), dict) else {}
aggregate_schema = tool_schemas.get("aggregate_messages", {}) if isinstance(tool_schemas, dict) else {}
properties = _schema_properties(aggregate_schema)