Skip to main content
Glama

memory_pack

Read-only

Build a formatted context block for a concept or task using keyword and semantic search, with automatic keyword-only fallback when embeddings are unavailable.

Instructions

Build a formatted context block for a concept or task using keyword and semantic search when embeddings are available, with automatic keyword-only fallback. Use for conceptually relevant context; use memory_search or memory_search_index for exact identifiers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNoFilter by memory kind
limitNoMax items to include
compactNoWhen true, render a scannable index of all items with full detail only for the top N (default 3). Saves tokens when broad overview matters more than per-item detail.
contextYesContext description to search for
projectNoFilter by project scope (matches sessions.project)
scope_idNoFilter by a single sharing domain scope_id
trust_biasNo
visibilityNo
personal_firstNo
ownership_scopeNo
compression_modeNoNear-related compression mode: off disables it, compact applies only to compact rendering, ids applies in all modes. Defaults to CODEMEM_PACK_COMPRESSION or compact.
exclude_actor_idsNo
exclude_scope_idsNoSharing domain scope_ids to exclude
include_actor_idsNo
include_scope_idsNoSharing domain scope_ids to include
exclude_visibilityNo
include_visibilityNo
compact_detail_countNoNumber of items to show in full detail in compact mode (default 3)
exclude_trust_statesNo
include_trust_statesNo
exclude_workspace_idsNo
include_workspace_idsNo
widen_shared_when_weakNo
exclude_workspace_kindsNo
include_workspace_kindsNo
widen_shared_min_personal_scoreNo
widen_shared_min_personal_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
contextYes
metricsYes
item_idsYes
pack_textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.44.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "context": {
      +      "type": "string"
      +    },
      +    "item_ids": {
      +      "items": {
      +        "maximum": 9007199254740991,
      +        "minimum": -9007199254740991,
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    "items": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "body": {
      +            "type": "string"
      +          },
      +          "confidence": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "id": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "metadata": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "title": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "kind",
      +          "title",
      +          "body",
      +          "confidence",
      +          "metadata"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "metrics": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "fallback_used": {
      +          "type": "boolean"
      +        },
      +        "limit": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "pack_item_ids": {
      +          "items": {
      +            "maximum": 9007199254740991,
      +            "minimum": -9007199254740991,
      +            "type": "integer"
      +          },
      +          "type": "array"
      +        },
      +        "pack_tokens": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "project": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "total_items": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "total_items",
      +        "pack_tokens",
      +        "fallback_used",
      +        "limit",
      +        "project",
      +        "pack_item_ids"
      +      ],
      +      "type": "object"
      +    },
      +    "pack_text": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "context",
      +    "items",
      +    "item_ids",
      +    "pack_text",
      +    "metrics"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds meaningful behavioral context beyond annotations: it discloses the automatic fallback from semantic to keyword-only search when embeddings are unavailable, and the compact mode's token-saving behavior. This is useful operational transparency.

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 two sentences and front-loads the core purpose and fallback behavior before the routing guidance. It is efficient, though the second sentence could arguably be more specific about which sibling to use for what. No wasted words.

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

Completeness3/5

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

Given the tool's complexity (27 parameters, output schema present), the description is adequate but not complete. It explains the search strategy and routing, but an agent would still be uncertain about what the output block looks like, how the many filter parameters interact, and what 'formatted context block' means concretely. The output schema helps, but the description doesn't bridge the gap for the large parameter surface.

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

Parameters3/5

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

Schema description coverage is only 37%, so the description carries some burden for parameter meaning. The description explains the core 'context' parameter and the 'compact' behavior, but most of the 27 parameters (e.g., trust_bias, personal_first, widen_shared_when_weak) are undocumented in both schema and description. The description adds value for the main parameters but doesn't compensate for the large undocumented surface.

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

Purpose4/5

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

The description states a specific verb ('Build') and resource ('formatted context block for a concept or task'), and distinguishes it from siblings by naming memory_search and memory_search_index for exact identifiers. It could be slightly clearer about what 'formatted context block' means, but the core purpose is clear.

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?

The description explicitly says 'Use for conceptually relevant context; use memory_search or memory_search_index for exact identifiers,' which provides a clear when-to-use and alternative. It doesn't enumerate all sibling alternatives (e.g., memory_recent, memory_timeline), but the primary routing guidance is present.

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