Skip to content

Conversation

@ajoslin103
Copy link
Contributor

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.

@jwtracy
Copy link

jwtracy commented May 7, 2025

@olaservo PTAL when you get a chance.

@oguzhankrcb
Copy link

please merge this request immediately it fixes the issue.

Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR and sorry for missing the ping earlier. Could you update the sdk in the package.json to "@modelcontextprotocol/sdk": "^1.15.1" while we're at it, since its on a very old SDK version? Thanks!

@olaservo olaservo merged commit 4b6ce39 into modelcontextprotocol:main Aug 3, 2025
18 checks passed
@ajoslin103 ajoslin103 deleted the ajoslin/memory branch August 5, 2025 16:13
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

4 participants