# pin_memory

A write tool on the 0CompactMem MCP server.

Agent View of the PolicyLayer registry record for `pin_memory`. HTML page: https://policylayer.com/tools/soolaugust-0compactmem/pin-memory

## Facts

- Tool: `pin_memory`
- Server: 0CompactMem (`soolaugust/0compactmem`) — https://policylayer.com/tools/soolaugust-0compactmem.md
- Homepage: https://github.com/soolaugust/0CompactMem
- Risk category: Write (Medium risk)
- Registry record: grade B, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "pin_memory",
    "arguments": {}
  }
}
```

## Why pin_memory is rated Medium

The tool name 'pin_memory' strongly suggests it pins memory entries (likely setting mlock/pinned flags on records in the SQLite store) to prevent eviction. This is a Write-category operation — it modifies the state of existing memory records reversibly (the sibling tool 'unpin_memory' confirms it is reversible).

From the tool's own definition: "Tool name 'pin_memory'; server description mentions 'mlock pinning' as a memory management primitive alongside 'demand paging' and 'kswapd eviction'"

## Use case

AI agents use pin_memory to create or update resources in 0CompactMem, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your 0CompactMem environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches 0CompactMem:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "pin_memory": {
      "limits": [
        {
          "counter": "pin_memory_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on 0CompactMem (7)

- `list_pinned` — Read — https://policylayer.com/tools/soolaugust-0compactmem/list-pinned.md
- `memory_applied` — Read — https://policylayer.com/tools/soolaugust-0compactmem/memory-applied.md
- `memory_hook_health` — Read — https://policylayer.com/tools/soolaugust-0compactmem/memory-hook-health.md
- `memory_lookup` — Read — https://policylayer.com/tools/soolaugust-0compactmem/memory-lookup.md
- `memory_stats` — Read — https://policylayer.com/tools/soolaugust-0compactmem/memory-stats.md
- `memory_write` — Write — https://policylayer.com/tools/soolaugust-0compactmem/memory-write.md
- `unpin_memory` — Write — https://policylayer.com/tools/soolaugust-0compactmem/unpin-memory.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=soolaugust-0compactmem · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/soolaugust-0compactmem
