Skip to content

Add 'get_network_routes' tool#404

Open
subpop wants to merge 1 commit into
rhel-lightspeed:mainfrom
subpop:add-ip-route
Open

Add 'get_network_routes' tool#404
subpop wants to merge 1 commit into
rhel-lightspeed:mainfrom
subpop:add-ip-route

Conversation

@subpop

@subpop subpop commented Apr 15, 2026

Copy link
Copy Markdown
Member

Add a fixed 'get_network_routes' tool. Inspired by the now stale #263.

@subpop subpop requested a review from a team as a code owner April 15, 2026 16:10
@github-actions

Copy link
Copy Markdown

For team members: test commit 612204f in internal GitLab

@codecov

codecov Bot commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/linux_mcp_server/parsers.py 82.22% 5 Missing and 3 partials ⚠️
Flag Coverage Δ
unittests 96.80% <91.66%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/linux_mcp_server/commands.py 89.47% <ø> (ø)
src/linux_mcp_server/formatters.py 95.76% <100.00%> (+0.43%) ⬆️
src/linux_mcp_server/models.py 100.00% <100.00%> (ø)
src/linux_mcp_server/tools/__init__.py 100.00% <100.00%> (ø)
src/linux_mcp_server/tools/network.py 100.00% <100.00%> (ø)
tests/tools/test_network.py 100.00% <100.00%> (ø)
src/linux_mcp_server/parsers.py 83.62% <82.22%> (-0.27%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alexxa

alexxa commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

/retest

@alexxa

alexxa commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Functional Tests failed due to the python default issue which was fixed and merged in #396 . When rebased, it perhaps will fail again unless #407 is merged first.

@github-actions

Copy link
Copy Markdown

For team members: test commit 63f0ccd in internal GitLab

@github-actions

Copy link
Copy Markdown

For team members: test commit f022bdb in internal GitLab

@owtaylor owtaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +130 to +132
if is_successful_output(returncode, stdout):
routes = parse_ip_route(stdout)
return format_routes(routes)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants