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.ToolGetStatePattern - Get Tool State Pattern

PreviousTopNext


MiniRobot Language (MRL) - MCP Logging & Security Commands

 

MCP.ToolGetStatePattern

Query Tool States Using Wildcard Pattern

 

Purpose

 

The MCP.ToolGetStatePattern command retrieves the states of multiple tools matching a wildcard pattern. This is useful for checking the status of tool categories or groups of related tools without querying each one individually.

 

Wildcard patterns allow you to query all tools in a category (e.g., all File* tools) or with specific naming conventions.

 

Syntax

 

MCP.ToolGetStatePattern|$$PATTERN|$$RETURN_VAR

 

Parameters

 

$$PATTERN - A wildcard pattern to match tool names. Use * to match any sequence of characters, ? to match a single character.

 

$$RETURN_VAR - The variable that will receive the results. The format is typically a delimited list of "ToolName=State" pairs.

 

Return Value

 

Returns a formatted list of matching tools and their states. Each entry typically includes the tool name and its current state (ENABLED or DISABLED). If no tools match the pattern, returns an empty string.

 

Examples

 

' Example 1: Get all File-related tools

MCP.ToolGetStatePattern|File*|$$FileTools

PRT.File tools status: $$FileTools

 

' Example 2: Get all Registry tools

MCP.ToolGetStatePattern|Registry*|$$RegTools

 

' Example 3: Get all tools (using * pattern)

MCP.ToolGetStatePattern|*|$$AllTools

PRT.All tools: $$AllTools

 

' Example 4: Using single character wildcard

MCP.ToolGetStatePattern|FileRead?|$$Variations

 

Remarks

 

Wildcard patterns use standard glob syntax:

* - Matches zero or more characters

? - Matches exactly one character

 

The returned format is implementation-specific but typically follows a structure like "Tool1=ENABLED|Tool2=DISABLED" or similar delimited format.

 

For checking a single specific tool, use MCP.ToolGetState instead.

 

Error Conditions

 

The command will fail with a parameter error if:

• The pattern parameter is missing

• The return variable parameter is missing

• Too many parameters are provided

 

See also:

 

MCP.ToolGetState - Get Tool State

MCP.ToolSetState - Set Tool State