Add 'get_network_routes' tool#404
Conversation
|
For team members: test commit |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
For team members: test commit |
|
For team members: test commit |
owtaylor
left a comment
There was a problem hiding this comment.
I think there are a lot of other possible tools of roughly this priority, but I don't think it hurts to go ahead and add this to the fixed toolset. It does seem to use a pattern that I think we're trying to move away from.
| if is_successful_output(returncode, stdout): | ||
| routes = parse_ip_route(stdout) | ||
| return format_routes(routes) |
There was a problem hiding this comment.
My understanding is that we're trying to move away from the parse => format path - either the tool output is well understood by the model and we're only going to make it worse by parsing and reformatting it, or we parse and return it in JSON form - perhaps with an idea of supporting "code mode" programmatic use of MCP servers in the future.
| ), | ||
| "network_routes": CommandGroup( | ||
| commands={ | ||
| "default": CommandSpec(args=("ip", "route")), |
There was a problem hiding this comment.
ip -j route exists at least back to RHEL 8, which would simplify parsing a lot. Probably could do it all with validation_alias.
destination: str = Field(validation_alias="dst")
gateway: str = ""
device: str = "" = Field(validation_alias="dev")
(src somehow becomes prefsrc)
Add a fixed 'get_network_routes' tool. Inspired by the now stale #263.