Downloads
Tool
Python CLI for the local gateway API.
Skill
Instructions for AI agents that know how to use skills.
The other focused reference files live beside it under references/.
What it can do
- read gateway status and diagnostics;
- verify authorization mode without exposing secrets;
- rotate and delete one agent Bearer token;
- call documented API paths for configuration and Modbus device setup;
- discover peer gateways through device-side mDNS and prepare
.localTCP tunnels; - convert, validate, and import SPODES/DLMS models and explicitly switch line ownership;
- list polling logs and download binary CBOR files safely;
- upload firmware, reboot, or factory reset only with a matching confirmation flag.
Compatible AI systems
The package is model-agnostic. It works with any AI assistant or agent runner that can use local files, execute a local CLI, or call a local HTTP tool from the operator computer.
- Works well with coding agents such as Codex, Claude Code, Cursor, Continue, and local agent frameworks.
- Works with ChatGPT or other hosted models only when a local connector, MCP server, or tool runner gives them access to this CLI or to the gateway API.
- Does not work from a plain hosted chat window that cannot reach your LAN and cannot run local commands.
Local install
- Install Python 3.10 or newer on the operator computer.
- Download
gateway_agent_tool.pyandgateway_hil_contract.pyinto the same folder. - Make sure the computer can open the gateway web interface, for example
http://192.168.1.85. - Rotate an agent token using local admin credentials.
- Store the token in the local agent environment, not in source code.
python gateway_agent_tool.py --base-url http://192.168.1.85 --username admin --password admin rotate-token --scopes read,test,configure
set GATEWAY_BASE_URL=http://192.168.1.85
set GATEWAY_AGENT_TOKEN=<token returned once>
python gateway_agent_tool.py status
Skill install
Create a folder named umec-gateway-agent in the skills directory of your AI tool,
then preserve the package structure with SKILL.md, agents/openai.yaml, and every references/*.md file.
umec-gateway-agent/
SKILL.md
agents/openai.yaml
references/api.md
Named Tool workflows
| Task | Command | Verification |
|---|---|---|
| Tunnel peers | discover-peers | Hostname, IPv4, ID, and no accidental is_self. |
| RS-485 owners | fieldbus-lines | Saved protocol and runtime owner for each line. |
| SPODES model | convert-wb-dlms-template, validate-dlms-template, import-dlms-device | Validation before write and export/read-back after import. |
| Protocol switch | set-fieldbus-line | Preview by default; Apply only with the exact gate and read-back. |
| Polling | set-line-polling | GET before and after explicit enable/disable. |
| CBOR | list-modbus-logs, download-modbus-log | Bounded listing, safe relative path, and matching local size. |
SPODES/DLMS is read-only in the current release. The Tool does not turn a compatibility command endpoint into permission to write a meter. MQTT threshold and forced interval apply equally to Generic and UMEC.
Safe workflow
- Ask the agent to inspect
/api/statusand/api/auth/session. - Ask it to describe the intended change before sending write requests.
- Use tokens without
dangerousfor normal work. - Use dangerous scope only during a planned maintenance window.
- For firmware upload, reboot, or factory reset, require the matching
--confirmvalue.
Examples
python gateway_agent_tool.py session
python gateway_agent_tool.py get /api/modbus/devices
python gateway_agent_tool.py discover-peers
python gateway_agent_tool.py fieldbus-lines
python gateway_agent_tool.py dlms-status --line-id 2
python gateway_agent_tool.py list-modbus-logs --storage auto --path "" --max 500
python gateway_agent_tool.py add-device --json @device.json
python gateway_agent_tool.py upload-firmware firmware.bin --confirm update --timeout 240