# exec

The `exec` command performs an action on a module within the system. It is a remote procedure call.

```javascript
{
    "id": 3,                 // tracking id
    "cmd": "exec",           // request type
    "sys": "sys-YNQ8ucvndO", // system id
    "mod": "Display",        // module name
    "index": 2,              // module index in the system
    "name": "switch_to",     // the driver function to call
    "args": ["hdmi"]         // The function arguments (if required)
}
```

The return value of the function is returned in the response, assuming it can be serialised into JSON.

```javascript
{
    "id": 3,
    "type": "success",
    "value": ["hdmi"]
}
```

If an error was raised, the error message is returned.

```javascript
{
    "id": 3,
    "type": "error",
    "code": 3,
    "msg": "ZeroDivisionError: divided by 0"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://engine.place.technology/api/control/websocket/commands/exec.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
