Table of Contents
Context
When running /cmdb-assistant:initial-setup on a fresh server (banditlabs), all NetBox MCP tools failed with JSON parsing errors despite the API returning valid responses.
- Command/tool:
dcim_list_devices,dcim_list_sites - Error:
Invalid JSON response from NetBox: Expecting value: line 8 column 1 (char 7)
Problem
The /initial-setup command asked users for a "NetBox server URL" with example https://netbox.company.com, but the NetBoxClient expected the full API URL including /api suffix.
Root cause: Inconsistency between setup wizard and code expectations:
- Setup saved:
NETBOX_API_URL=https://netbox.hotserv.cloud - Code expected:
NETBOX_API_URL=https://netbox.hotserv.cloud/api
The validation test in the setup wizard incorrectly appended /api/ to the URL when testing, making it pass even though the saved config was wrong. This masked the bug during setup.
Solution
- Updated setup wizard example to show URL with
/apisuffix - Added instruction to auto-append
/apiif user forgets - Fixed validation test to use URL as-is (consistent with actual usage)
PR: #132
Files: plugins/cmdb-assistant/commands/initial-setup.md
Prevention
When writing setup wizards that save configuration:
- Example values must match exact format expected by code
- Validation tests must use config exactly as saved - don't transform it
- Document URL format requirements explicitly in prompts
- Test fresh installations on new machines, not just existing setups
Related
- Issue: [Bug] NetBox MCP tools fail JSON parsing despite valid API response (#126)
- PR: fix(cmdb-assistant): correct NetBox API URL format in setup wizard (#132)
- Component: cmdb-assistant, NetBox MCP
Tags: cmdb-assistant, netbox, setup-wizard, configuration, url-format, validation, bug-fix