Hey everybody, I’m again to exploring how agentic AI would possibly match right into a community engineer’s workflow and turn out to be a helpful instrument in our instrument chest.
In my weblog submit, Making a NetAI Playground for Agentic AI Experimentation, I started this journey by exploring how we are able to make the most of Mannequin Context Protocol (MCP) servers and the idea of “instruments” to allow our AI brokers to work together with community units by sending present instructions. If you happen to haven’t learn that submit but, positively test it out as a result of it’s some actually fabulous prose. Oh, and there’s some actually cool NetAI stuff in there, too. 😉
Whereas it was fascinating to see how effectively AI may perceive a community engineering activity offered in pure language, create a plan, after which execute that plan in the identical approach I might, there was a limitation in that first instance. The one “instrument” the agent had was the flexibility to ship present instructions to the community gadget. I needed to explicitly present the small print in regards to the community gadget—particulars which are available in my “supply of fact.”
To appreciate the ability of agentic AI, NetAI must have entry to the identical info as human community engineers. For right this moment’s submit, I wished to discover how I may present source-of-truth knowledge to my NetAI agent. So, let’s dig in!
NetBox presents an MCP server
NetBox has lengthy been a favourite instrument of mine. It’s an open-source community supply of fact, written in Python, and accessible in numerous deployment choices. NetBox has been with me via a lot of my community automation exploration; it appeared becoming to see the way it may match into this new world of AI.
Initially, I anticipated to place a easy MCP server collectively to entry NetBox knowledge. I shortly discovered that the group at NetBox Labs had already launched an open-source fundamental MCP server on GitHub. It solely supplies “learn entry” to knowledge, however as we noticed in my first NetAI submit, I’m beginning out slowly with read-only work anyway. Having a place to begin for introducing some supply of fact into my playground was going to considerably pace up my exploration. Completely superior.
Including NetBox to the NetAI playground
Have you ever ever been engaged on a venture and gotten distracted by one other “cool thought?” No? I suppose it’s simply me then… 🙂
Like most of my community labs and explorations, I’m utilizing Cisco Modeling Labs (CML) to run the community playground for AI. This wasn’t the primary time I wished to have NetBox as a part of a CML topology. And as I used to be prepping to play with the NetBox MCP server, I had the thought…
Hank, wouldn’t or not it’s nice if there have been a CML NetBox node that could possibly be simply added to a topology, and that might routinely populate NetBox with the topology info from CML?
In fact I answered myself…
Heck yeah, Hank, that’s a terrific thought!
My thoughts instantly began understanding the small print of tips on how to put it collectively. I knew it will be tremendous simple and quick to knock out. And I figured different folks would discover it helpful as effectively. So I took a “brief detour.”


I’m certain lots of you raised your eyebrows once I mentioned “tremendous simple” and “quick.” You had been proper to be skeptical, in fact. It wasn’t fairly as simple or easy as I anticipated. Nonetheless, I used to be in a position to get it working, and it’s actually cool and helpful for anybody who desires so as to add not solely a NetBox server to a CML community but in addition have it pre-populated with the units, hyperlinks, and IP particulars from the CML topology.
I nonetheless have to compile the documentation for the brand new node definition earlier than I can submit it to the CML-Group on GitHub for others to make use of. Nonetheless, think about this weblog submit my public accountability submit, indicating that it’s forthcoming. You may maintain me to it.
However sufficient of the aspect monitor on this weblog submit, let’s get again to the AI stuff!
Including NetBox MCP server to LM Studio
As I discussed within the final weblog submit, I’m utilizing LM Studio to run the Massive Language Mannequin (LLM) for my AI agent regionally on my laptop computer. The primary cause is to keep away from sending any community info to a cloud AI service. Though I’m utilizing a “lab community” for my exploration, there are particulars within the lab setup that I do NOT wish to be public or danger ending up in future coaching knowledge for an LLM.
If this exploration is profitable, utilizing the strategy with manufacturing knowledge could be the following step; nonetheless, that’s positively not one thing that aligns with a accountable AI strategy.
Cloning down the netbox-mcp-server code from GitHub was simple sufficient. The README included an instance MCP server configuration that offered the whole lot I wanted to replace my mcp.json file in LM Studio so as to add it to my already configured pyATS MCP server.
{ "mcpServers": { "pyats": { "url": "http://localhost:8002/mcp" }, "netbox": { "command": "uv", "args": [ "--directory", "/Users/hapresto/code/netbox-mcp-server", "run", "server.py" ], "env": { "NETBOX_URL": "http://{{MY NETBOX IP ADDRESS}/", "NETBOX_TOKEN": "{{MY NETBOX API TOKEN}}" } } } }
As quickly as I saved the file, LM Studio found the instruments accessible.


There are three instruments offered by the NetBox MCP server.
- netbox_get_objects: Generic instrument that bulk retrieves objects from NetBox. It helps “filters” to restrict the returned objects.
- netbox_get_object_by_id: Instrument to retrieve a single object of any kind from NetBox given an ID.
- netbox_get_changelogs: Instrument to lookup audit and alter occasions
I used to be, and proceed to be, within the strategy utilized by the NetBox Labs of us on this MCP server. Relatively than offering instruments to “get_devices” and “get_ips,” they’ve a single instrument. NetBox’s APIs and object mannequin are effectively thought out, and make a generic strategy like this doable. And it actually means much less code and improvement time. Nonetheless, it primarily offers API entry to the LLM and shifts the load for “thought” and “processing the information” again to the LLM. As Agentic AI and MCP are nonetheless very new requirements and approaches, there aren’t actual finest practices and particulars on what works finest in design patterns right here but. I’ll come again to this strategy and what I see as some doable downsides in a while within the submit.
I then loaded the newly launched open mannequin by OpenAI, gpt-oss, and despatched the primary question.


My first thought… Success. After which I scratched my head for a second. 10 units? Scroll again as much as the CML topology picture and rely what number of units are within the topology. Go forward, I’ll wait…
Yeah. I counted seven units, too. And if I verify NetBox itself, it additionally reveals seven units.


So what occurred? LM Studio reveals the precise response from the instrument name, so I went and checked. Positive sufficient, solely seven units’ price of data was returned. I then remembered that one of many notoriously meme-worthy failings of many AI instruments is the flexibility to rely. Blueberries anybody?
So this became a pleasant teachable second about AI… AI is incredible, however it may be unsuitable. And will probably be dangerous with a few of the strangest issues. Keep vigilant, my buddies. 😉
After resolving the problem with the ten units, I spent a substantial period of time asking extra questions and observing the AI make the most of the instruments to retrieve knowledge from NetBox. Basically, I used to be fairly impressed, and getting access to source-of-truth knowledge might be key to any Agentic NetAI work we undertake. Once you do that out by yourself, positively mess around and see what you are able to do with the LLM and your NetBox knowledge. Nonetheless, I wished to discover what was doable in bringing instruments collectively.
Combining source-of-truth instruments with community operations instruments
I wished to begin out with one thing that felt each helpful and fairly easy. So I despatched this immediate.
I might wish to confirm that router01 is bodily related to the appropriate units per the NetBox cable connections. > Observe: The credentials for router01 are: `netadmin / 1234QWer` Are you able to: 1. Verify NetBox for what community units router01 is meant to be related to, and on what interfaces 2. Lookup the Out of Band IP deal with and SSH port from NetBox, use these to hook up with router01. 3. Use CDP on router01 to verify what neighbors are seen 4. Examine the NetBox to CDP info.
I nonetheless needed to inform the LLM what the credentials are for the units. That’s as a result of whereas NetBox is a incredible supply of fact, it does NOT retailer secrets and techniques/credentials. I’m planning on exploring what instrument choices exist for pulling knowledge from secret storage in a while.
If you’re questioning why I offered a listing of steps to sort out this downside slightly than let the LLM “determine it out,” the reply is that whereas GenAI LLMs can appear “sensible,” they’re NOT community engineers. Or, extra particularly, they haven’t been skilled and tuned to BE community engineers. Possible, the long run will provide tuned LLMs for particular job roles slightly than the general-purpose LLMs of right this moment. Till then, the most effective observe for “immediate engineering” is to offer the LLM with detailed directions on what you need it to do. That dramatically will increase the probabilities of success and the pace at which the LLM can sort out the issue.
Let’s have a look at how the LLM dealt with step one within the request, wanting up the gadget connections.


At first look, this seems to be fairly good. It “knew” that it wanted to verify the Cables from NetBox. Nonetheless, there are some issues right here. The LLM crafted what seems to be a legitimate filter for the lookup: “device_a_name”: “router01.” Nonetheless, that’s truly NOT a legitimate filter. It’s a hallucination.
A whole weblog submit could possibly be written on the explanation this hallucination occurred, however the TL;DR is that the NetBox MCP server does NOT present specific particulars on tips on how to craft filters. It depends on the LLM to have the ability to construct a filter based mostly on the coaching knowledge. And whereas each LLM has benefited from the copious quantities of NetBox documentation accessible on the web, in all of my testing, I’ve but to have any LLM efficiently craft the right filter for something however essentially the most fundamental searches for NetBox.
This has led me to begin constructing my very own “opinion” on how MCP servers must be constructed, and it includes requiring much less “guessing” from the LLMs to make use of them. I’ll most actually be again extra on this matter in later posts and shows. However sufficient on that for now.
The LLM doesn’t know that the filter was unsuitable; it assumes that the cables returned are all related to router01. This results in different errors within the reporting, because the “Thought” course of reveals. It sees each Cable 1 and Cable 4 as related to Ethernet 0/0. The reality is that Cable 4 is related to switch01 Ethernet0/0. We’ll see how this elements in later within the abstract of knowledge.
As soon as it has the cable info, the LLM proceeds and completes the remainder of the instrument’s use to collect knowledge.


Discovering the Out of Band IP and SSH port was easy. However the first try to run “present cdp neighbors” failed as a result of the LLM initially didn’t use the SSH port as a part of the instrument name. However this is a wonderful instance of how Agentic AI can perceive errors from MCP servers and “repair them.” It realized the necessity for SSH and tried once more.
I’ve seen a number of instances the place AI brokers will resolve errors with instrument calls via trial and error and iteration. In actual fact, some MCP servers appear to be designed particularly with this because the anticipated habits. Good error messages may give the LLM the context required to repair the issue. Just like how we as people would possibly react and regulate once we get an error from a command or API name we ship. This is a wonderful energy of LLMs; nonetheless, I feel that MCP servers can and must be designed to restrict the quantity of trial and error required. I’ve additionally seen LLMs “hand over” after too many errors.
Let’s check out the ultimate response from the AI agent after it accomplished gathering and processing the outcomes.


So how did it do?
First, the nice issues. It accurately acknowledged that the hyperlink to switch01 from NetBox matched a CDP entry. Wonderful. It additionally referred to as out the lacking CDP neighbor for the “mgmt” swap. It’s lacking as a result of “mgmt” is an unmanaged swap and doesn’t run CDP.
It might have been actually “cool” if the LLM had seen that the gadget kind of “mgmt” was “Unmanaged Change” and commented on that being the explanation CDP info was lacking. As already talked about, the LLM is NOT tuned for community engineering use instances, so I’ll give it a go on this.
And now the errors… The issue with the filter for the cable resulted in two errors within the findings. There aren’t two cables on Ethernet0/0, and the “Different unused cables” aren’t related to router01.
Hank’s takeaways from the take a look at
I used to be positively a bit of dissatisfied that my preliminary checks weren’t 100% profitable; that might have made for a terrific story on this weblog submit. But when I’m sincere, operating into a number of issues was even higher for the submit.
AI will be downright superb and jaw-dropping with what it may do. But it surely isn’t excellent. We’re within the very early days of Agentic AI and AIOps, and there’s a lot of labor left to do, from growing and providing tuned LLMs with domain-specific information to discovering the most effective practices for constructing the most effective functioning instruments for AI use instances.
What I did see on this experiment, and all my experiments and studying, is the true potential for NetAI to offer community engineers a strong instrument for designing and working their networks. I’ll be persevering with my exploration and stay up for seeing that potential come to fruition.
There’s a lot extra I discovered from this venture, however the weblog submit is getting fairly lengthy, so it’ll have to attend for one more installment. Whereas I’m engaged on that, let me know what you consider AI and the potential for making your each day work as a community engineer higher.
How has AI helped you latterly? What’s the most effective hallucination you’ve run into to date?
Let me know within the feedback!
Learn subsequent:
Join Cisco U. | Be a part of the Cisco Studying Community right this moment without cost.
Study with Cisco
X | Threads | Fb | LinkedIn | Instagram | YouTube
Use #CiscoU and #CiscoCert to hitch the dialog.
Share: