fix mcp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user