-
Notifications
You must be signed in to change notification settings - Fork 166
Support for multiple log files in the nodes_log query #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support for multiple log files in the nodes_log query #419
Conversation
Signed-off-by: Neeraj Krishna Gopalakrishna <[email protected]>
Signed-off-by: Neeraj Krishna Gopalakrishna <[email protected]>
| OneOf: []*jsonschema.Schema{ | ||
| { | ||
| Type: "string", | ||
| Description: `Single query specifying a service or file from which to return logs. Example: "kubelet" or "kubelet.log"`, | ||
| }, | ||
| { | ||
| Type: "array", | ||
| Description: `Array of queries specifying multiple services or files from which to return logs`, | ||
| Items: &jsonschema.Schema{ | ||
| Type: "string", | ||
| }, | ||
| }, | ||
| }, | ||
| Description: `query specifies service(s) or files from which to return logs (required). Can be a single string or array of strings. Example: "kubelet" to fetch kubelet logs, "/<log-file-name>" to fetch a specific log file from the node (e.g., "kubelet.log" or "kube-proxy.log"), or ["kubelet", "kube-proxy.log"] for multiple sources`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes like this are where I personally would like to see some form of evals to see if this does actually improve the LLMs performance, especially compared to just having an array, and not treating the single query as a separate case.
Since we should have some basic evals in CI here in a few days, coming from https://github.com/genmcp/gevals, can we hold off on merging this until we see eval results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had this one in my queue to do some tests locally.
It's not only evals, but many agents are able to call multiple tools (or multiple invocations of the same tool) in parallel.
I'm not sure if implementing the funnel ourselves would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal was to fetch the same set of 10 log files from 10 different nodes. This PR allows us to make 10 calls instead of 100 (10 nodes X 10 files each). Since this is a deterministic and repeatable task, implementing it in the MCP server made sense to me. Also MCP server would run remotely beside the kubernetes cluster and hence reducing the number of calls made from clients.
Summary
Enhanced the nodes_log MCP tool to accept multiple log queries in a single call, reducing the number of round trips between the MCP client and server when analyzing node logs from multiple files.
Previously, fetching logs from multiple node sources (e.g., kubelet and crio) required multiple separate MCP tool invocations. While the underlying Kubernetes API (/api/v1/nodes/{name}/proxy/logs) is designed for single log file access, this creates friction at the MCP layer where users want to analyze logs holistically.
Pain points with the old approach:
Solution
Modified the query parameter to support both single string and array of strings using JSON Schema's oneOf:
Additional Fixes
Testing