From c91b8bd64869d2900da0d309b97e839adb0882ca Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Thu, 2 Jul 2026 09:10:56 +0200 Subject: [PATCH] fix: derive MCP doc example values from schema example/default/enum (#31394) --- go.mod | 2 +- go.sum | 4 +- server/mcp/openapi.md | 176 ++++++++++++++++++++++-------------------- 3 files changed, 95 insertions(+), 87 deletions(-) diff --git a/go.mod b/go.mod index 39e0a6974..dc1227b64 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/enbility/eebus-go v0.7.1-0.20260608105936-abdcf864d0cf github.com/enbility/ship-go v0.6.1-0.20260518113001-134687068e3c github.com/enbility/spine-go v0.7.1-0.20260520153416-0104ce40c885 - github.com/evcc-io/openapi-mcp v0.6.1-0.20260503092507-6199c7ad3baf + github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4 github.com/evcc-io/optimizer v0.0.0-20260613102250-473d3906e657 github.com/evcc-io/rct v0.2.0 github.com/evcc-io/tesla-proxy-client v0.0.0-20260324063928-151fe10796ae diff --git a/go.sum b/go.sum index ab55839d2..5ce9a297c 100644 --- a/go.sum +++ b/go.sum @@ -150,8 +150,8 @@ github.com/evcc-io/modbus v0.0.0-20250501165638-8b6f1fbdb7ea h1:F6eyC8V8wvc3ranl github.com/evcc-io/modbus v0.0.0-20250501165638-8b6f1fbdb7ea/go.mod h1:swrNGAVgI1r/3d/sEKE7qgujdRR9aHVPYKyc3gvpVTc= github.com/evcc-io/ocpp-go v0.0.0-20251212212612-b7f92ee0443b h1:5vFr7wOwoi5ylybUnxxBk1U3FRF2+3Sf0sKx8thxw18= github.com/evcc-io/ocpp-go v0.0.0-20251212212612-b7f92ee0443b/go.mod h1:2kcukDdhui4u730VfnYVWuwzDLgw+mBRGDir/QAyBhg= -github.com/evcc-io/openapi-mcp v0.6.1-0.20260503092507-6199c7ad3baf h1:rnObcCvSoPJpYVJoHAxFAtzy/lMLsPN1TgK3yq6nWrU= -github.com/evcc-io/openapi-mcp v0.6.1-0.20260503092507-6199c7ad3baf/go.mod h1:YyOx4zwr6xVUcchAETHERZ+75cZMIrdcjVIZFwBlE1Q= +github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4 h1:aGM3NwDsKbnmiaO10ptbvEolRAUThWJEsObiAWFDU/c= +github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4/go.mod h1:YyOx4zwr6xVUcchAETHERZ+75cZMIrdcjVIZFwBlE1Q= github.com/evcc-io/optimizer v0.0.0-20260613102250-473d3906e657 h1:pZW9CGsXsJNHQnSGOzenl8Caz68+vDsliO22vhPGIKs= github.com/evcc-io/optimizer v0.0.0-20260613102250-473d3906e657/go.mod h1:cHMeq6GfoXQ8LxqY4LH1wn/hrgYEn+ka5RPI1CF37SY= github.com/evcc-io/rct v0.2.0 h1:qjXKI7NKwW5YpEKEb27MwLMBaR4ne2Kd2cPV2PYTKn4= diff --git a/server/mcp/openapi.md b/server/mcp/openapi.md index aa06a1a86..eadfa6a99 100644 --- a/server/mcp/openapi.md +++ b/server/mcp/openapi.md @@ -122,7 +122,7 @@ Prevent home battery discharge during vehicle fast charging. ```json call setBatteryDischargeControl { - "enable": "example" + "enable": "true" } ``` @@ -162,7 +162,7 @@ Set battery buffer SoC. ```json call setBufferSoc { - "soc": 123.45 + "soc": 60 } ``` @@ -182,7 +182,7 @@ Set battery buffer start SoC. ```json call setBufferStartSoc { - "soc": 123.45 + "soc": 60 } ``` @@ -202,7 +202,7 @@ Directly controls the mode of all controllable batteries. evcc behavior like 'pr ```json call setExternalBatteryMode { - "batteryMode": "example" + "batteryMode": "normal" } ``` @@ -222,7 +222,7 @@ Set battery priority SoC. ```json call setPrioritySoc { - "soc": 123.45 + "soc": 60 } ``` @@ -242,7 +242,7 @@ Set grid connection operating point. ```json call setResidualPower { - "power": 123.45 + "power": 2500 } ``` @@ -332,15 +332,15 @@ Returns aggregated energy history data. Aggregate granularity defaults to 15 min ```json call getEnergyHistory { - "aggregate": "example", - "format": "example", - "from": "example", - "group": "example", - "grouped": true, - "lang": "example", - "name": "example", - "title": "example", - "to": "example" + "aggregate": "1h", + "format": "json", + "from": "2026-07-01T00:00:00Z", + "group": "battery", + "grouped": false, + "lang": "de", + "name": "db:8", + "title": "Battery", + "to": "2026-07-02T00:00:00Z" } ``` @@ -433,8 +433,8 @@ Assigns vehicle to loadpoint. ```json call assignLoadpointVehicle { - "id": 123, - "name": "example" + "id": 1, + "name": "vehicle_1" } ``` @@ -454,7 +454,7 @@ Delete charging plan. Only available when a vehicle without SoC is connected. ```json call deleteLoadpointEnergyPlan { - "id": 123 + "id": 1 } ``` @@ -474,7 +474,7 @@ Delete cost or emission limit for fast-charging with grid energy. ```json call deleteLoadpointSmartCostLimit { - "id": 123 + "id": 1 } ``` @@ -494,7 +494,7 @@ Delete limit for feed-in priority optimization. ```json call deleteLoadpointSmartFeedInPriorityLimit { - "id": 123 + "id": 1 } ``` @@ -514,7 +514,7 @@ Returns the current charging plan for this loadpoint. ```json call getLoadpointPlan { - "id": 123 + "id": 1 } ``` @@ -536,8 +536,8 @@ Simulate charging plan based on energy goal. Does not alter the actual charging ```json call previewLoadpointEnergyPlan { - "energy": 123.45, - "id": 123, + "energy": 25.5, + "id": 1, "timestamp": "example" } ``` @@ -562,11 +562,15 @@ Simulate repeating charging plan and return the result. Does not alter the actua ```json call previewLoadpointRepeatingPlan { - "hourMinuteTime": "example", - "id": 123, - "soc": 123.45, - "timezone": "example", - "weekdays": "..." + "hourMinuteTime": "12:30", + "id": 1, + "soc": 60, + "timezone": "Europe/Berlin", + "weekdays": [ + 1, + 3, + 4 + ] } ``` @@ -588,8 +592,8 @@ Simulate charging plan based on SoC goal. Does not alter the actual charging pla ```json call previewLoadpointSocPlan { - "id": 123, - "soc": 123.45, + "id": 1, + "soc": 60, "timestamp": "example" } ``` @@ -610,7 +614,7 @@ Remove vehicle from loadpoint. Connected vehicle is treated as guest vehicle. ```json call removeLoadpointVehicle { - "id": 123 + "id": 1 } ``` @@ -631,8 +635,8 @@ Enable or disable battery boost. When active, the maximum available home battery ```json call setLoadpointBatteryBoost { - "enable": "example", - "id": 123 + "enable": "true", + "id": 1 } ``` @@ -653,8 +657,8 @@ Set the SoC limit for battery boost. Home battery will be used to support chargi ```json call setLoadpointBatteryBoostLimit { - "id": 123, - "soc": 123.45 + "id": 1, + "soc": 60 } ``` @@ -675,8 +679,8 @@ Delay before charging stops in solar mode. ```json call setLoadpointDisableDelay { - "delay": 123, - "id": 123 + "delay": 60, + "id": 1 } ``` @@ -697,8 +701,8 @@ Specifies the grid draw power to stop charging in solar mode. ```json call setLoadpointDisableThreshold { - "id": 123, - "threshold": 123.45 + "id": 1, + "threshold": 2500 } ``` @@ -719,8 +723,8 @@ Delay before charging starts in solar mode. ```json call setLoadpointEnableDelay { - "delay": 123, - "id": 123 + "delay": 60, + "id": 1 } ``` @@ -741,8 +745,8 @@ Specifies the available surplus power to start charging in solar mode. ```json call setLoadpointEnableThreshold { - "id": 123, - "threshold": 123.45 + "id": 1, + "threshold": 2500 } ``` @@ -763,8 +767,8 @@ Updates the energy limit of the loadpoint. Only available for guest vehicles and ```json call setLoadpointEnergyLimit { - "energy": 123.45, - "id": 123 + "energy": 25.5, + "id": 1 } ``` @@ -786,8 +790,8 @@ Create charging plan with fixed time and energy target. Only available when a ve ```json call setLoadpointEnergyPlan { - "energy": 123.45, - "id": 123, + "energy": 25.5, + "id": 1, "timestamp": "example" } ``` @@ -809,8 +813,8 @@ Updates the maximum current of the loadpoint. ```json call setLoadpointMaxCurrent { - "current": 123.45, - "id": 123 + "current": 16, + "id": 1 } ``` @@ -831,8 +835,8 @@ Updates the minimum current of the loadpoint. ```json call setLoadpointMinCurrent { - "current": 123.45, - "id": 123 + "current": 16, + "id": 1 } ``` @@ -853,8 +857,8 @@ Changes the charging behavior of the loadpoint. ```json call setLoadpointMode { - "id": 123, - "mode": "example" + "id": 1, + "mode": "off" } ``` @@ -875,8 +879,8 @@ Updates the allowed phases of the loadpoint. Selects the desired phase mode for ```json call setLoadpointPhases { - "id": 123, - "phases": "example" + "id": 1, + "phases": "3" } ``` @@ -897,7 +901,7 @@ Updates the charging plan strategy for the loadpoint. ```json call setLoadpointPlanStrategy { - "id": 123, + "id": 1, "requestBody": "..." } ``` @@ -919,7 +923,7 @@ Set loadpoint priority. ```json call setLoadpointPriority { - "id": 123, + "id": 1, "priority": 123 } ``` @@ -942,7 +946,7 @@ Set cost or emission limit for fast-charging with grid energy. ```json call setLoadpointSmartCostLimit { "cost": 123.45, - "id": 123 + "id": 1 } ``` @@ -964,7 +968,7 @@ Set limit for feed-in priority optimization. ```json call setLoadpointSmartFeedInPriorityLimit { "cost": 123.45, - "id": 123 + "id": 1 } ``` @@ -985,8 +989,8 @@ Sets the session SoC limit. Cleared on disconnect. Takes precedence over the veh ```json call setLoadpointSocLimit { - "id": 123, - "soc": 123.45 + "id": 1, + "soc": 60 } ``` @@ -1006,7 +1010,7 @@ Starts the automatic vehicle detection process. ```json call startLoadpointVehicleDetection { - "id": 123 + "id": 1 } ``` @@ -1026,7 +1030,7 @@ Delete charging session. ```json call deleteSession { - "id": 123 + "id": 1 } ``` @@ -1047,8 +1051,8 @@ Returns a list of HEMS grid limitation events. ```json call getGridSessions { - "format": "example", - "lang": "example" + "format": "csv", + "lang": "de" } ``` @@ -1071,10 +1075,10 @@ Returns a list of charging sessions. ```json call getSessions { - "format": "example", - "lang": "example", - "month": 123, - "year": 123 + "format": "csv", + "lang": "de", + "month": 2, + "year": 2025 } ``` @@ -1095,7 +1099,7 @@ Update vehicle, loadpoint or odometer of a charging session. Only provided field ```json call updateSession { - "id": 123, + "id": 1, "requestBody": "..." } ``` @@ -1131,10 +1135,14 @@ Returns the latest log lines. ```json call getSystemLogs { - "areas": "...", + "areas": [ + "lp-1", + "site", + "db" + ], "count": 123, - "format": "example", - "level": "example" + "format": "txt", + "level": "DEBUG" } ``` @@ -1154,7 +1162,7 @@ Enable or disable telemetry. Note: Telemetry requires sponsorship. ```json call setTelemetryStatus { - "enable": "example" + "enable": "true" } ``` @@ -1180,7 +1188,7 @@ Returns the prices or emission values for the upcoming hours ```json call getTariffInfo { - "type": "example" + "type": "grid" } ``` @@ -1200,7 +1208,7 @@ Delete the charging plan ```json call deleteVehicleSocPlan { - "name": "example" + "name": "vehicle_1" } ``` @@ -1221,8 +1229,8 @@ Vehicle will be fast-charged until this SoC is reached. ```json call setVehicleMinSoc { - "name": "example", - "soc": 123.45 + "name": "vehicle_1", + "soc": 60 } ``` @@ -1243,7 +1251,7 @@ Updates the charging plan strategy for the vehicle. ```json call setVehiclePlanStrategy { - "name": "example", + "name": "vehicle_1", "requestBody": "..." } ``` @@ -1265,8 +1273,8 @@ Charging will stop when this SoC is reached. ```json call setVehicleSocLimit { - "name": "example", - "soc": 123.45 + "name": "vehicle_1", + "soc": 60 } ``` @@ -1288,8 +1296,8 @@ Create charging plan with fixed time and SoC target. ```json call setVehicleSocPlan { - "name": "example", - "soc": 123.45, + "name": "vehicle_1", + "soc": 60, "timestamp": "example" } ``` @@ -1311,7 +1319,7 @@ Updates the repeating charging plan. ```json call updateVehicleRepeatingPlans { - "name": "example", + "name": "vehicle_1", "requestBody": "..." } ```