Skip to main content
Glama

pin_memory

Lock a memory chunk to a project to prevent automatic eviction. Choose 'hard' for permanent retention or 'soft' for retention under memory pressure.

Instructions

将指定 chunk 锁定到当前项目,阻止被自动淘汰。
OS 类比:mlock(addr, len) — 将页面锁定在进程地址空间,阻止 swap out。

pin_type:
  'hard' — 所有淘汰路径跳过该 chunk(stale reclaim、DAMON DEAD、kswapd ZONE_MIN)
           适用:设计约束、不可变决策、关键架构知识
  'soft' — 保护 stale reclaim 和 DAMON DEAD,但 kswapd 内存极度紧张时仍可淘汰
           适用:重要但非关键的量化证据、近期决策

Args:
    chunk_id: 要锁定的 chunk ID(可从 memory_lookup 结果中获取)
    pin_type: 'hard' 或 'soft'(默认 'soft')
    project: 项目 ID(默认自动解析当前目录)

Returns:
    操作结果描述

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chunk_idYes
pin_typeNosoft
projectNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses all behavioral details: it prevents eviction by specific mechanisms (stale reclaim, DAMON DEAD, kswapd ZONE_MIN) and distinguishes hard (all) vs soft (except kswapd under extreme pressure). It also notes the return type.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections, OS analogy, and bullet points. It is informative but slightly long; however, every part adds value, so it remains efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (nuanced pinning behavior) and lack of annotations, the description covers purpose, usage, behavior, parameters, and return. It references related tools (memory_lookup) and includes an output schema, though the description already mentions a result description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description fully explains all 3 parameters: chunk_id (source from memory_lookup), pin_type (values and meaning), and project (default and auto-detection). This significantly adds value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool pins a chunk to prevent automatic eviction, with a helpful OS analogy (mlock). It distinguishes from siblings by focusing on pinning vs. listing, lookup, stats, and unpinning.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains when to use 'hard' vs 'soft' pinning with concrete examples (design constraints vs. important evidence) and mentions where to get the chunk_id (memory_lookup). It does not explicitly state when not to use it, but the trade-offs are implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/soolaugust/0CompactMem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server