MCP Commands - Logging & Security

<< 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

MCP.ToolSetState - Set Tool State

PreviousTopNext


MiniRobot Language (MRL) - MCP Logging & Security Commands

 

MCP.ToolSetState

Enable or Disable a Tool

 

Purpose

 

The MCP.ToolSetState command enables or disables a specific MCP tool at runtime. This allows dynamic control over which tools are available for use without restarting the server.

 

Disabling tools can enhance security by restricting access to sensitive operations, while enabling tools makes them available for use in scripts.

 

Syntax

 

MCP.ToolSetState|$$TOOL_NAME|$$STATE

 

Parameters

 

$$TOOL_NAME - The name of the tool to enable or disable. This should match the tool identifier as registered with the MCP server.

 

$$STATE - The desired state. Valid values: ENABLED, DISABLED, 1, 0, TRUE, FALSE, ON, OFF (case-insensitive).

 

Return Value

 

OK - Tool state was updated successfully

ERROR - Invalid tool name or state value

 

Examples

 

' Example 1: Enable the FileRead tool

MCP.ToolSetState|FileRead|ENABLED

 

' Example 2: Disable a sensitive tool

MCP.ToolSetState|ExecuteCommand|DISABLED

 

' Example 3: Using numeric values

MCP.ToolSetState|RegistryWrite|1

 

' Example 4: Using ON/OFF keywords

MCP.ToolSetState|FileDelete|OFF

 

Remarks

 

Tool state changes take effect immediately. Any scripts currently using a tool that gets disabled will be able to continue using it until completion, but new invocations will be blocked.

 

Tool names are case-sensitive and must match exactly as registered with the MCP server.

 

State values are case-insensitive: ENABLED, enabled, and Enabled are all valid.

 

Error Conditions

 

The command will fail with a parameter error if:

• The tool name parameter is missing

• The state parameter is missing

• An invalid state value is specified

• Too many parameters are provided

 

See also:

 

MCP.ToolGetState - Get Tool State

MCP.ToolGetStatePattern - Get Tool State Pattern