|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Functional Memory - Tool execution and security management (SLL-ONLY) > MCP Commands - Functional Memory |
MiniRobot Language (MRL) - Functional Memory (SPR only - not in public MCP-Server)
⚡ SPR only - not in public MCP-Server FEATURE
This command is only available when using the MCP server as an SLL (Server-Side Library). It cannot be called via HTTP/MCP protocol.
MCP.Read / MCP.FM.Read
Read result from Functional Memory (read-once)
Syntax
MCP.Read|$$KEY|$$RETURN_VAR
MCP.FM.Read|$$KEY|$$RETURN_VAR
Parameters
$$KEY
The Functional Memory key to read from, in the format Category::Function (e.g., "FileTools::GetDirectoryListing"). This corresponds to the function that was executed via the fm_execute mechanism.
$$RETURN_VAR
The variable to receive the JSON result payload that was stored by the tool execution.
Return Value
Returns the JSON result payload stored at the specified key. Returns an empty string if the key does not exist or has already been read.
Description
MCP.Read retrieves a result from the Functional Memory system that was stored by a previous tool execution. This is a read-once operation - the result is automatically deleted from Functional Memory after being read.
This command is used to retrieve results from tools executed via the Functional Memory mechanism (fm_execute), where results are stored with an internal "fm::" prefix for temporary access.
Examples
Example 1: Read a file listing result
' Read the result from a previous FileTools::GetDirectoryListing call
MCP.Read|FileTools::GetDirectoryListing|$$DirResult
DSP.$$DirResult
Example 2: Check if result exists
MCP.Read|DataTools::Query|$$Result
IVV.LEN($$Result)!0
DSP.Result received:§§$$Result
ELS.
DSP.No result available (already read or not found)
EIF.
SLL Implementation
SLL Function: MCP_FM_Read
Source File: MCP_FuncMem_Subs.inc
Remarks
• This command is SPR only - not in public MCP-Server and cannot be called via the MCP HTTP protocol
• This is a read-once operation - the result is deleted after reading
• To preserve the result, use MCP.Move to transfer it to permanent memory
• For non-destructive reading, use MCP.ReadLines instead
• Results are stored with an internal "fm::" prefix (handled automatically)
See also:
• MCP.Move - Move result to permanent memory
• MCP.ReadLines - Read specific lines without deleting
• MEM.RCL - Recall from standard memory