# memory_stats

查询 AIOS 知识库的统计信息（chunk 数量、类型分布、近期活跃度）。

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

## Facts

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

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

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

## Why memory_stats is rated Low

This tool retrieves statistical metadata about memory/knowledge base state without creating, modifying, deleting, or executing code. The read-only nature of statistics queries, combined with the lack of any side effects or state changes, classifies this firmly as a Read operation. Severity is low because accessing metadata statistics poses minimal risk even if misused by an agent.

From the tool's own definition: "Tool name 'memory_stats' and description indicate querying/retrieving statistics (chunk count, type distribution, activity metrics) from a knowledge base. The verb '查询' (query) explicitly describes a read operation with no modification or execution capability."

## Use case

AI agents call memory_stats to retrieve information from 0CompactMem without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

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

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "memory_stats": {}
  }
}
```

## 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_write` — Write — https://policylayer.com/tools/soolaugust-0compactmem/memory-write.md
- `pin_memory` — Write — https://policylayer.com/tools/soolaugust-0compactmem/pin-memory.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
