Skip to main content
Glama

reinforce

Boost memory relevance and reset decay for AI agents by reinforcing topic mentions, automatically upgrading questions to interests after repeated engagement.

Instructions

The user mentioned this topic again — boost its relevance and reset decay clock. After 5 mentions, "question" auto-upgrades to "interest".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoMemory ID
contentNoContent to match

Implementation Reference

  • The handler function for the 'reinforce' tool, which updates the mention count, last_reinforced timestamp, and potentially re-categorizes a memory.
    function handleReinforce(args) {
      const { id, content } = args;
      if (!id && !content) return { error: 'Provide "id" or "content" to reinforce' };
    
      const memories = loadMemories();
      let target;
    
      if (id) {
        target = memories.find(m => m.id === id);
      } else {
        const c = content.toLowerCase();
        target = memories.find(m => m.content.toLowerCase().includes(c));
      }
    
      if (!target) return { error: 'Memory not found' };
    
      target.mention_count += 1;
      target.last_reinforced = Date.now();
    
      if (target.mention_count >= 5 && target.category === 'question') {
        target.category = 'interest';
        target.base_weight = CATEGORY_CONFIG['interest'].base_weight;
        target.decay_halflife_days = CATEGORY_CONFIG['interest'].decay_halflife_days;
      }
    
      saveMemories(memories);
      const rel = computeRelevance(target);
    
      return {
        id: target.id,
        content: target.content,
        mention_count: target.mention_count,
        category: target.category,
        relevance: rel.relevance,
        status: rel.status,
        message: `Reinforced. Mention #${target.mention_count}. Decay clock reset.`
      };
    }
  • index.js:408-415 (registration)
    The MCP tool definition for 'reinforce', including its input schema.
    {
      name: 'reinforce',
      description: 'The user mentioned this topic again — boost its relevance and reset decay clock. After 5 mentions, "question" auto-upgrades to "interest".',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Memory ID' },
          content: { type: 'string', description: 'Content to match' }
Behavior4/5

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

With no annotations provided, the description carries the full burden and succeeds in disclosing key behavioral traits: relevance boosting, decay clock resetting, and the specific auto-upgrade logic from 'question' to 'interest' after 5 mentions. It lacks disclosure on idempotency or failure modes (e.g., memory not found).

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

Conciseness5/5

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

Two dense sentences with zero waste. The first sentence front-loads the core action (boost/reset), while the second provides critical threshold information (5-mention upgrade). Every clause earns its place.

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

Completeness4/5

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

For a 2-parameter tool with full schema coverage and no output schema, the description adequately covers the core behavioral mechanics. It could be improved by mentioning error handling (what if ID doesn't exist?) or return values, but the auto-upgrade mechanic provides valuable operational context.

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 100%, establishing a baseline of 3. The description mentions 'this topic' which loosely maps to the 'content' parameter, but adds no semantic clarification on the relationship between 'id' and 'content' (mutually exclusive? complementary?) given that both are optional parameters.

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 clearly states the tool boosts relevance and resets the decay clock for topics mentioned 'again,' implying operation on existing memories. It effectively distinguishes from sibling 'remember' (creation) through the word 'again,' though explicit comparison is absent.

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

Usage Guidelines3/5

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

The description implies usage context (when user mentions topic again) but provides no explicit when-not-to-use guidance or named alternatives. It doesn't clarify whether to use 'id' or 'content' parameters when both are optional (0 required params).

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/ShipItAndPray/mcp-memory'

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