add mcp fix

This commit is contained in:
larssand
2026-06-30 21:30:30 +02:00
parent baa3bb95e8
commit 6a63de0e37
2 changed files with 18 additions and 3 deletions

View File

@@ -66,8 +66,9 @@ class GraylogMcpClient:
credentials = base64.b64encode(f"{value}:token".encode("utf-8")).decode("ascii")
return f"Basic {credentials}"
def probe(self) -> dict[str, object]:
self.session_id = None
def probe(self, *, force_new_session: bool = False) -> dict[str, object]:
if force_new_session:
self.session_id = None
initialized = self._call(
"initialize",
{"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "fgAI", "version": "0.1"}},
@@ -90,7 +91,7 @@ class GraylogMcpClient:
except RuntimeError as exc:
if not self._should_reconnect(str(exc)):
raise
self.probe()
self.probe(force_new_session=True)
return self._call("tools/call", {"name": name, "arguments": arguments})
@staticmethod