Get Log Neighbors
get_log_neighborsReturn the logs chronologically around a given logId.
Designed for the "what happened right before/after this alert?" question. Returns the anchor log plus N logs strictly older and N logs strictly newer, all scoped (by default) to the same sourceInstanceId — the same pod or process — so you don't see interleaved replicas.
Defaults: before: 3 after: 3 sameSource: true
Set sameSource=false for cross-pod neighbour queries (e.g. "what else was the cluster doing at this moment?").
Returns: anchor: the log identified by logId before: logs older than anchor, sorted oldest-first (chronological) after: logs newer than anchor, sorted oldest-first (chronological) queryStats: rowsReturned, elapsedMs
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"logId": "<logId>"
},
"name": "get_log_neighbors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | How many logs strictly newer than the anchor to return (default 3, max 50) | |
| logId | Yes | ULID of the anchor log | |
| before | No | How many logs strictly older than the anchor to return (default 3, max 50) | |
| sameSource | No | Scope to the anchor's sourceInstanceId (same pod/process). Default true. |