mcp issues

This commit is contained in:
larssand
2026-06-30 12:47:31 +02:00
parent 86065eca59
commit c76e260516
5 changed files with 55 additions and 30 deletions

View File

@@ -69,20 +69,23 @@ class GraylogAggregateSource:
self.stream = stream
self.query = query or "*"
def fetch_count(self, *, range_seconds: int = 300) -> dict[str, object]:
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": [],
}
def fetch_count(self, *, range_seconds: int = 300, probe_status: dict[str, object] | None = None) -> dict[str, object]:
if probe_status is not None:
status = dict(probe_status)
else:
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)