EnglishDeutsch/api/energyGitHub · iceccarelli
Grimaldi EngineeringCluster-Steuerung · Frankfurt
Energy Intelligence · Cluster 1

Agent-Tool-Verträge

Agenten erreichen Infrastruktur nur über diese Tools. Kein Tool schreibt einen Sollwert. Jedes Tool trägt die neun Anforderungen unten; „specified“ heißt: Vertrag fixiert, Implementierung existiert noch nicht.

Jedes Tool braucht

schemaauthenticationauthorizationdeterministic validationtimeoutprovenanceloggingfailure behaviourtest coverage

Tools

inspect_grid_state()

Snapshot of the twin at a timestamp: buses, branches, assets, measurements, active alarms.

Seiteneffekt
read · specified
Scope
tenant:read
Timeout
2000 ms
Eingabe
{ tenant, network_id, at?: iso8601, depth?: 1|2|3 }
Ausgabe
{ snapshot_id, state, provenance }
Validierung
network_id belongs to tenant; at within retention
Bei Fehler
Return last consistent snapshot with stale=true; never partial state.
Modul
kernel · twin

retrieve_asset()

Asset record, parameters, limits, connection point, health features.

Seiteneffekt
read · specified
Scope
tenant:read
Timeout
1000 ms
Eingabe
{ tenant, asset_id }
Ausgabe
{ asset, limits, provenance }
Validierung
asset_id in tenant scope
Bei Fehler
404 typed error; no fuzzy match.
Modul
kernel

run_power_flow()

AC (Newton) or DC power flow on a snapshot with optional modifications.

Seiteneffekt
compute · specified
Scope
tenant:simulate
Timeout
10000 ms
Eingabe
{ snapshot_id, method: ac|dc|pinn, modifications?: Action[] }
Ausgabe
{ result_id, voltages, flows, converged, iterations, solver, latency_ms }
Validierung
modifications typed and within asset limits
Bei Fehler
converged=false is a result, not an error; solver exception → typed error, no retry with another method silently.
Modul
physics

run_contingency()

N-1 / N-k screening over a snapshot.

Seiteneffekt
compute · specified
Scope
tenant:simulate
Timeout
30000 ms
Eingabe
{ snapshot_id, set: n-1|list, limit_margin_pct }
Ausgabe
{ violations[], worst_case, latency_ms }
Validierung
contingency list ⊂ network elements
Bei Fehler
Partial results carry completed=false and the list of unevaluated cases.
Modul
physics

run_forecast()

Probabilistic forecast for load, PV, price or constraint at a node.

Seiteneffekt
compute · specified
Scope
tenant:read
Timeout
5000 ms
Eingabe
{ tenant, target, horizon_h, quantiles[] }
Ausgabe
{ forecast_id, series[quantile], model_version, backtest_error }
Validierung
horizon ≤ model max; quantiles in (0,1)
Bei Fehler
Fallback to persistence baseline, flagged baseline=true.
Modul
forecast

simulate_action()

Roll the twin forward under a candidate action set.

Seiteneffekt
simulate · specified
Scope
tenant:simulate
Timeout
20000 ms
Eingabe
{ snapshot_id, actions: Action[], horizon_min }
Ausgabe
{ sim_id, trajectory, constraint_report }
Validierung
actions signed by proposer; within declared envelopes
Bei Fehler
Any constraint evaluation failure marks the sim invalid; invalid sims cannot be cited by request_authorization.
Modul
twin · physics

calculate_flexibility()

Available up/down flexibility per asset and aggregate over a window.

Seiteneffekt
compute · specified
Scope
tenant:read
Timeout
5000 ms
Eingabe
{ tenant, asset_ids[], window }
Ausgabe
{ per_asset[], aggregate, assumptions[] }
Validierung
window within forecast horizon
Bei Fehler
Assets with unknown limits are excluded and listed.
Modul
optimize

optimize_dispatch()

MILP dispatch for BESS / DER portfolio against price, constraints and SoC.

Seiteneffekt
compute · specified
Scope
tenant:simulate
Timeout
60000 ms
Eingabe
{ tenant, portfolio, objective, horizon_h, constraints }
Ausgabe
{ plan_id, schedule, objective_value, baseline_value, gap, solver_status }
Validierung
constraints reference known assets; objective from an enum
Bei Fehler
Infeasible → return the infeasibility certificate; time-limit → best bound with gap.
Modul
optimize

validate_constraints()

Deterministic pass/fail of a plan against physics and policy, with margins.

Seiteneffekt
compute · specified
Scope
tenant:simulate
Timeout
10000 ms
Eingabe
{ plan_id | sim_id }
Ausgabe
{ pass, violations[], margins }
Validierung
input exists and is not stale
Bei Fehler
Fail closed: any evaluation error is a fail.
Modul
physics · policy

request_authorization()

Submit a validated plan for human or envelope authorization. The only tool that leaves the sandbox — and it produces a request, not a setpoint.

Seiteneffekt
request · specified
Scope
tenant:request
Timeout
3000 ms
Eingabe
{ plan_id, sim_id, validation_id, explanation_id, requested_window }
Ausgabe
{ request_id, status: pending|approved|denied, expires_at }
Validierung
plan, sim and validation ids agree; validation.pass = true; explanation present
Bei Fehler
Denied by default on any inconsistency. Never retried automatically.
Modul
NeuralBridge

generate_explanation()

Plain-language and structured explanation of a plan: assumptions, trade-offs, what was rejected.

Seiteneffekt
compute · specified
Scope
tenant:read
Timeout
15000 ms
Eingabe
{ plan_id, audience: operator|manager|auditor, lang: en|de }
Ausgabe
{ explanation_id, text, structured }
Validierung
plan exists
Bei Fehler
No explanation → no authorization request possible.
Modul
planning

create_incident()

Open an incident with evidence attached (snapshots, sims, forecasts).

Seiteneffekt
record · specified
Scope
tenant:write:incident
Timeout
3000 ms
Eingabe
{ tenant, severity, title, evidence_ids[] }
Ausgabe
{ incident_id }
Validierung
evidence ids exist in tenant
Bei Fehler
Queued locally, retried, never dropped.
Modul
kernel

generate_audit_record()

Append a hash-chained record of who asked what, what was computed, what was decided.

Seiteneffekt
record · specified
Scope
system
Timeout
1000 ms
Eingabe
{ actor, tool, inputs_hash, outputs_hash, decision? }
Ausgabe
{ record_id, chain_hash }
Validierung
previous chain hash matches
Bei Fehler
Chain break halts all request tools until resolved.
Modul
shared › audit

Stand 2026-09-05Maschinenlesbar: /api/energy/toolsAlle Ressourcen: /api/energy/index

Verfasst und gepflegt von Vincenzo Ceccarelli Grimaldi, Frankfurt am Main.