|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Logging & Security - Logging and access control > MCP Commands - Logging & Security |
MiniRobot Language (MRL) - MCP Logging & Security Commands
MCP.SetScriptTimeout / MCP.SCTO
Configure Script Execution Timeout
Purpose
The MCP.SetScriptTimeout command sets the maximum execution time allowed for scripts before they are automatically terminated. This prevents runaway or hung scripts from consuming resources indefinitely.
Setting an appropriate timeout ensures system stability while allowing sufficient time for legitimate long-running operations to complete.
Syntax
MCP.SetScriptTimeout|$$SECONDS
MCP.SCTO|$$SECONDS
Parameters
$$SECONDS - The timeout duration in seconds. Use 0 to disable the timeout (infinite execution time, not recommended).
Return Value
OK - Timeout was set successfully
ERROR - Invalid parameter (negative value or non-numeric)
Examples
' Example 1: Set timeout to 30 seconds
MCP.SetScriptTimeout|30
' Example 2: Set timeout to 5 minutes using short form
MCP.SCTO|300
' Example 3: Set short timeout for quick operations
MCP.SetScriptTimeout|10
' Example 4: Set long timeout for complex operations
MCP.SCTO|600
Remarks
The timeout setting is effective immediately for all subsequent script executions. Scripts already running are not affected by timeout changes.
When a script exceeds the timeout, it is forcefully terminated. This may leave resources in an inconsistent state, so scripts should be designed to handle timeouts gracefully when possible.
MCP.SetScriptTimeout and MCP.SCTO are aliases for the same command. You can use either form.
Error Conditions
The command will fail with a parameter error if:
• The seconds parameter is missing
• A negative value is specified
• A non-numeric value is specified
• Too many parameters are provided
See also:
• MCP.ToolGetState - Get Tool State
• MCP.ToolSetState - Set Tool State