Skip to content

calling [mcp/memory] read_graph without args #1276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ajoslin103
Copy link

fixes: #1273

Problem is that the mcp/memory code [index.js] guards against missing args

  if (!args) {
    throw new Error(`No arguments provided for tool: ${name}`);
  }

But read_graph does not take any args

    case "read_graph":
      return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.readGraph(), null, 2) }] };

@olaservo olaservo added server-memory Reference implementation for the Memory MCP server - src/memory bug Something isn't working labels Apr 18, 2025
@olaservo
Copy link
Member

Could you add some details on how this fix was tested?

@jwtracy
Copy link

jwtracy commented Apr 30, 2025

@ajoslin103 's fix worked for me so I can answer how I tested on their behalf,

Using the https://github.com/mark3labs/mcphost project, I created my own for, added @ajoslin103 's remote, checked out their incoming branch here, and altered my mcphost config file, ~/.mcp.json, from the npx @modelcontextprotocol/memory command to the following:

    "memory": {
      "command": "node",
      "args": [
        "/Users/jwtracy/Source/jwtracy/servers/src/memory/index.ts"
      ]
    },

Before changing the config file, the steps I took to reproduce the error were to provide the memory prompt context to the chat before this interaction resulting in an error:

  You: tell me everything you remember
2025/04/30 09:31:11 INFO 🔧 Using tool name=memory__read_graph

Error calling tool read_graph: No arguments provided for tool: read_graph

After I updated my mcphost config file to the above and providing the memory mcp prompt context, I was able to avoid the error:

  You: tell me everything you remember
2025/04/30 10:23:12 INFO 🔧 Using tool name=memory__read_graph

  Assistant:


  I don't have any information stored in my memory yet.

Note, it has no memory since I just cloned this repo and the memory.json file is not yet present.

I scoured the mark3labs mcp and mcphost projects for an appropriate place to fix this and found that this server response was the source of the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server-memory Reference implementation for the Memory MCP server - src/memory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mcp/memory] read_graph can't be called without args
3 participants