+24
−1
Loading
The MCP server could only reach the NBI, so none of the Optical Controller's
P2MP / lightpath / RSA operations were callable, and provisioning an optical
service through the Service API needed two calls an agent had no way to know
about. 26 tools are added (90 total):
- Config/App/McpServer: resolve the Optical Controller's base URL the same way
as the NBI's (TFS_OPTICAL_URL, else the injected opticalcontroller host/port)
and add optical_request() alongside api_request().
- Base: OpticalControllerToolHandler, with optional trailing path segments for
the controller's positional routes.
- Custom: tfs_provision_optical_service performs CreateService+UpdateService
and rolls back if the second step fails, so an optical service is never left
registered but unprovisioned; tfs_delete_optical_service repeats
DeleteService until the service is gone, which an optical band requires.
- Definitions/Registry: P2MP compute/delete/recompute/get-active-paths, direct
multi-lightpath add/delete, source addition, per-source subflow recompute,
link-failure marking, point-to-point flexi-grid and multi-granular
lightpaths, optical-band deletion, inspection and alarm subscriptions.
Three bugs this surfaced in the P2MP provisioning path:
- roadms.py: drop the 'band' leaf from media channels; the ROADMs reject it
(bad-element) and the channel is already defined by its frequency range.
- OpticalConfig.py: P2MP settings carry no single center frequency, so
'frequency' is present but None and UpdateOpticalConfig failed on int(None),
leaving the ROADM media channels unrecorded.
- TaskExecutor/OCServiceHandler: pass bidir to deconfigure_optical_device_pmp,
as the non-P2MP path already does; without it disable_media_channel stopped
after the first channel and left the rest of a P2MP tree on the ROADMs.
Verified against the dummy P2MP topology (T1.1/T1.2/T1.3 -> R1 -> R2 -> T2.1):
all 26 tools exercised, P2MP service provisioned and deleted through the MCP
tools with the ROADM media channels created and fully torn down again, and no
device, service or context errors.
Co-Authored-By:
Claude Opus 5 <noreply@anthropic.com>