get_cell_protocol
Retrieve memory behavior templates for cognitive architectures, enabling structured memory management in AI systems through predefined cell protocols.
Instructions
Returns a cell protocol template describing memory behaviors.
Args:
name: Identifier of the cell protocol (key_value, windowed, episodic).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | cell.protocol.key_value |
Implementation Reference
- The core handler function for the 'get_cell_protocol' MCP tool. Decorated with @mcp.tool() for registration. Validates input using CellProtocolInput, retrieves the protocol template using get_cell_protocol_template, or lists available protocols if not found.@mcp.tool() def get_cell_protocol(name: str = "cell.protocol.key_value") -> str: """ Returns a cell protocol template describing memory behaviors. Args: name: Identifier of the cell protocol (key_value, windowed, episodic). """ try: model = CellProtocolInput(name=name) except ValidationError as e: return f"Input Validation Error: {e}" template = get_cell_protocol_template(model.name) if template: return template available = ", ".join(sorted(CELL_PROTOCOL_REGISTRY.keys())) return ( f"// Cell protocol '{model.name}' not found. Available protocols: {available}" )
- Pydantic BaseModel used for input schema validation in the get_cell_protocol tool handler.class CellProtocolInput(BaseModel): name: str = Field( "cell.protocol.key_value", min_length=1, description="Cell protocol name." )
- Helper function called by the tool handler to fetch cell protocol templates from the registry.def get_cell_protocol_template(name: str) -> Optional[str]: """Return a cell protocol template by identifier. Args: name: Protocol key such as 'cell.protocol.key_value'. Returns: The corresponding template string if registered. """ return CELL_PROTOCOL_REGISTRY.get(name)
- Global registry dictionary mapping protocol names to their template strings, used by get_cell_protocol_template.CELL_PROTOCOL_REGISTRY: Final[Dict[str, str]] = { "cell.protocol.key_value": CELL_PROTOCOL_KEY_VALUE, "cell.protocol.windowed": CELL_PROTOCOL_WINDOWED, "cell.protocol.episodic": CELL_PROTOCOL_EPISODIC, }