Skip to main content
Glama

recall_memory_tool

Retrieve relevant information from project memory using keywords, questions, or statements to support decision-making and maintain context.

Instructions

从项目记忆中回忆相关信息

Args:
    interest: 想要回忆的任何东西,可以是一句陈述、一个问题甚至是关键词

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
interestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'recall_memory_tool' MCP tool. It is registered via @mcp.tool() decorator and delegates the core logic to recall_memory.
    @mcp.tool()
    async def recall_memory_tool(interest: str) -> str:
        """从项目记忆中回忆相关信息
    
        Args:
            interest: 想要回忆的任何东西,可以是一句陈述、一个问题甚至是关键词
        """
        return await recall_memory(interest, _registry)
  • Helper function implementing the recall logic using a small LLM agent with ListMemoriesTool, ReadMemoryTool, and a submit tool for generating the final report.
    async def recall_memory(interest: str, registry: MemoryRegistry) -> str:
        """使用 small_agent 实现的回忆流程"""
        list_tool = ListMemoriesTool(registry)
        read_tool = ReadMemoryTool(registry)
    
        final_tools: list[ToolUnionParam] = [
            {
                "name": "submit",
                "description": "提交回忆报告",
                "input_schema": {
                    "type": "object",
                    "properties": {
                        "report": {
                            "type": "string",
                            "description": "综合回忆报告(Markdown 格式)",
                        }
                    },
                    "required": ["report"],
                },
            }
        ]
    
        initial_prompt = f"""尝试从记忆库回忆与这个有关的信息:{interest}
    
    请按以下指导处理:
    1. 使用 list_memories 工具搜索相关记忆
    2. 使用 read_memory 工具读取相关记忆
    3. 基于读取的内容,调用 submit 提交综合报告
    
    提示:
    - list_memories 返回的是按匹配度排序的结果
    - read_memory 需要提供每个记忆唯一的关键词组
    - 报告除了直接回应用户的兴趣点,还应该包含补充详细的背景信息
    - 如果没有相关内容,请报告'没有相关记忆'"""
    
        result = await small_agent(
            initial_prompt=initial_prompt,
            tools=[list_tool, read_tool],
            final=final_tools,
            maxIter=10,
        )
    
        if result is None:
            return "查询超时,未能生成报告"
    
        tool_name, tool_input = result
        if tool_name == "submit":
            return tool_input.get("report", "")
    
        return "未知错误"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool recalls information but doesn't describe what happens when no matches are found, whether the recall is fuzzy or exact, what format the returned information takes, or any limitations like memory size or access permissions. The description provides minimal behavioral context beyond the basic operation.

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 appropriately concise with two sentences that each serve a clear purpose. The first sentence states the tool's function, and the second explains the parameter. There's no wasted text or redundancy. The structure is logical and front-loaded with the core purpose.

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 has an output schema (which handles return values), a single parameter with good semantic explanation in the description, and no complex annotations, the description is minimally adequate. However, it lacks important context about the memory system's scope, how recall interacts with the sibling memorize tool, and behavioral details that would help the agent use it effectively.

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

Parameters4/5

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

The description provides meaningful semantic context for the single parameter 'interest' that goes beyond the schema. While schema description coverage is 0%, the description explains that 'interest' can be '一句陈述、一个问题甚至是关键词' (a statement, a question, or even keywords), which clarifies the flexible nature of this input. This compensates well for the lack of schema descriptions.

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

Purpose3/5

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

The description states the tool '从项目记忆中回忆相关信息' (recalls related information from project memory), which provides a basic verb+resource combination. However, it's somewhat vague about what constitutes 'project memory' and doesn't clearly differentiate from its sibling 'memorize_memory_tool' beyond the recall vs. memorize distinction. The purpose is understandable but lacks specificity about the scope and nature of the memory system.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention the sibling 'memorize_memory_tool' or explain the relationship between recalling and memorizing. There's no context about prerequisites, appropriate scenarios, or limitations. The agent receives no help in deciding when this tool is the right choice.

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

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