MCP Commands - Memory Bank

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Internet and Network > MCP. - MCP (Model-Context Protocol) server operations > Memory Bank - Commands for storing and recalling data >

MCP Commands - Memory Bank

MEM.STO

PreviousTopNext


MiniRobot Language (MRL) - MCP Memory Bank

 

MEM.STO

Store value in memory (with persistence option)

Alias: MEM.Store, MCP.MemSto

 

Syntax

 

MEM.STO|$$KEY|$$VALUE

MEM.STO|$$KEY|$$VALUE|PERM

MEM.STO|$$KEY|$$VALUE|TEMP

 

Parameters

 

$$KEY

The unique name to identify this stored value. Keys are case-sensitive and can contain any text except the pipe character (|).

 

$$VALUE

The text value to store. This can be a literal string, variable, or any text data.

 

PERM | TEMP (Optional)

PERM: Permanent storage - persists across server restarts.

TEMP: Temporary storage (default) - lost when server restarts.

 

Return Value

 

None. The value is stored in memory with the specified key.

 

Description

 

MEM.STO stores a value in the MCP Memory Bank under the specified key name. The value can later be retrieved using MEM.RCL or MEM.R.

 

By default (or when TEMP is specified), the value is stored only for the current session and will be lost when the MCP server restarts. When PERM is specified, the value is persisted to disk and will survive server restarts.

 

If a value already exists for the given key, it will be overwritten with the new value.

 

Examples

 

Example 1: Store temporary data

' Store some working data (temporary by default)

MEM.STO|$$WorkData|This is temporary session data

 

Example 2: Store permanent configuration

' Store user preferences (permanent)

MEM.STO|$$UserPrefs|Theme:Dark;Lang:DE|PERM

 

Example 3: Explicitly temporary storage

' Explicitly store as temporary

MEM.STO|$$Cache|Cached result data|TEMP

 

Example 4: Update an existing value

' Store initial value

MEM.STO|$$Counter|100

 

' Later, overwrite with new value

MEM.STO|$$Counter|200

 

Remarks

 

• The key name is case-sensitive. "MyKey" and "mykey" are different keys.

• Key names cannot contain the pipe character (|) as it is used as a delimiter.

• Values can contain any text including newlines (use §§ for line breaks in MiniRobot).

• Use descriptive key names to avoid collisions with other scripts.

• The Memory Bank feature requires the RESOURCES capability in MCP server configuration.

• For simple temporary storage, consider using MEM.S as a shortcut.

 

Related Commands

 

MEM.RCL - Recall/retrieve stored value

MEM.S - Simple store (shortcut)

MEM.EXS - Check if key exists

MEM.DEL - Delete a key

Memory Bank Overview