memory: create_entities, create_relations and add_observations could declare idempotentHint: true
维护者通常 1 天内回复
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 78/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, nodejs, typescript
- 领域
- api
调研方向
这三个工具在 v2/main 分支的 src/memory/index.ts 中声明,大约在第 797、842 和 888 行,目前它们的 idempotentHint 为 false。请先检查 createEntities、createRelations 和 addObservations 处理函数是否已经跳过重复的工作,然后将这三个提示改为 true,与删除类工具保持一致。完成的标准是:声明已更新,并且记忆服务器的工具列表输出中这三个工具显示为 true。
由索引模型根据 Issue 内容生成。
描述
Which server?
memory (@modelcontextprotocol/server-memory)
Protocol era
Both, or not era-specific
MCP client
mcp-groundtruth's own JSON-RPC stdio client (test harness, protocolVersion 2025-11-25)
The problem
create_entities, create_relations and add_observations declare idempotentHint: false, although a repeated identical call has no additional effect. Clients that respect the hint may therefore decline to auto-retry them, for example after a timeout. The three delete tools already declare idempotentHint: true for the same reason: a repeat has nothing left to do.
All three already skip work that has been done (src/memory/index.ts at bbb701e, the commit tested):
createEntitiesskips names that already exist or repeat earlier in the batch (L517–L532).createRelationsskips relations that already exist or repeat in the batch (L534–L564).addObservationsskips contents the entity already has (L566–L585).
v2/main at 38569bd still declares false (L797, L842, L888), and the three methods are unchanged between the two commits.
Solution you have in mind (optional)
Set idempotentHint: true on these three tools. Their behaviour doesn't change; only the declared hint does, matching the delete tools.
Which MCP feature does it demonstrate? (optional)
Tool annotations (idempotentHint). Reference servers are widely copied, so their hints are often reused as a model for what each one means.
https://modelcontextprotocol.io/specification/2025-11-25/server/tools
Alternatives or workarounds you have tried
Leaving it as is is safe: clients just retry less than they could. A client could hardcode a per-tool override, but that defeats the purpose of declaring hints on the server.
Already built it locally?
No local change, so no prompt to share. How this was verified:
I tested the three tools against a seeded graph with mcp-groundtruth, a conformance harness I maintain, sandboxed, on Node 24. There were 12 argument sets: existing names with a different type or new observations, duplicates within a batch, a missing relation endpoint, a partly invalid batch, and mixes of new and existing items. In every set a second identical call left the stored graph unchanged, and calls that returned errors wrote nothing. Reports and review.
Reproduce, with Node 24 first on PATH:
git clone https://github.com/shreyasbhakta/mcp-groundtruth && cd mcp-groundtruth
git checkout 9ba8f289e6f11aa1d334c0af57b803548d3883a1
uv run mcpgt prepare memory
uv run mcpgt run memory --audit --observe-concurrent --tool create_entities --tool create_relations --tool add_observations
Limits:
- Only repeated identical arguments were tested; that is what the hint covers.
- The concurrent evidence is weak. In 180 two-process attempts the requests overlapped on the wire and none diverged, but the lock file serializes writes.
- One seed graph and 12 hand-chosen argument sets, on macOS only.
Environment: server built from source at bbb701e and run over stdio; client sends protocolVersion: "2025-11-25" and the server answers with the same; macOS, Node 24.21.0.
Before you submit
- I searched existing issues and this is not a duplicate.
- This is a request for this repository or one of its servers, not a new server, the MCP specification or an SDK.
- 主要语言
- JavaScript
- 星标
- 91.2k
- 派生
- 11.8k
- 平均合并
- 7 小时 51 分钟
- 30 天内合并 PR
- 121
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/servers 的其他 Issue
-
documentation v2
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/servers#5170 ·
维护者通常 1 天内回复
-
documentation v2
难度 2/5 1-3 小时 新手友好度 72/100
modelcontextprotocol/servers#5164 ·
维护者通常 1 天内回复
-
memory: persistence EISDIR test fails on Node 26.7 (the path suffix depends on the Node minor, not the major)可能已有人在做 @ace-ify 今天认领。 未关闭bug server-memory v2
难度 2/5 1-3 小时 新手友好度 83/100
modelcontextprotocol/servers#5162 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
modelcontextprotocol/servers#5156 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
modelcontextprotocol/servers#5134 · 1 条评论 ·
维护者通常 1 天内回复
查看 modelcontextprotocol/servers 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)可能已有人在做 @Jxxunnn 今天认领。 未关闭Browser Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 82/100
getsentry/sentry-javascript#25497 · 1 条评论 ·
维护者通常 1 天内回复
-
resource: destroying a resource calls AbortController.abort() without a reason, creating an AbortError with a stack trace each time可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area: core
难度 2/5 1-3 小时 新手友好度 75/100
angular/angular#71422 · 1 条评论 ·
维护者通常 1 天内回复
-
bug status: needs triage
难度 2/5 1-3 小时 新手友好度 72/100
facebook/docusaurus#12739 · 1 条评论 ·
维护者通常 1 天内回复
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 1/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复