Rules: browser WebMCP tools
Session context
-
The assistant MUST choose the execution context deliberately: without
forma call runs in a new navigator session, withformin that form's own session together with the user's unsaved edits. Before applying in a form's session, it MUST include the user's unsaved edits in the scope confirmed with the user:APPLYsaves them along with the script's changes. -
The assistant MUST NOT treat waiting for the user's answer as proof of a failed call and repeat a changing action: a synchronous dialog keeps the call waiting for that answer.
Client operations
- To change the filters, sortings, current row or values the user sees, the assistant MUST use
lsfusion_client, rather than try to reproduce those interface operations with an eval script. It MUST uselsfusion_evalorlsfusion_execfor application logic.
For example, showing only unposted invoices is a filter of the form, set with lsfusion_client; posting an invoice is an action of the application, run with lsfusion_exec, or with lsfusion_eval as a script.
Customization
Saved customization code is compiled when a form is created, the application's when the client starts.
-
The assistant MUST NOT claim that saving customization code changes an already open form or the running client: the change shows only once the form is created, or the client started, again.
-
To recreate the form it is working in, the assistant SHOULD call
SystemEvents.formRecreate[]throughlsfusion_execwithformaddressing that form: recreating that one form is enough. It MUST NOT use this action to recreate another form from the navigator: it recreates the form in whose context it runs. -
Before calling
System.reload[], the assistant MUST ask the user: it reloads the whole page without the leave confirmation, so unsaved edits in every open form, the current one included, are lost.