Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

memory: create_entities, create_relations and add_observations could declare idempotentHint: true

Đang mở Phù hợp với người mới
#5,153 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
78/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
api

Hướng nghiên cứu

Ba công cụ được khai báo trong src/memory/index.ts trên v2/main, khoảng dòng 797, 842 và 888, nơi idempotentHint hiện là false. Hãy kiểm tra xem các handler createEntities, createRelations và addObservations đã bỏ qua công việc trùng lặp hay chưa, sau đó đổi cả ba hint thành true, giống với các công cụ xóa. Hoàn thành khi các khai báo đã được cập nhật và đầu ra liệt kê công cụ của máy chủ bộ nhớ hiển thị true cho ba công cụ này.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement v2
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):

  • createEntities skips names that already exist or repeat earlier in the batch (L517–L532).
  • createRelations skips relations that already exist or repeat in the batch (L534–L564).
  • addObservations skips 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.
Ngôn ngữ chính
JavaScript
Star
91.2k
Fork
11.8k
Merge trung bình
6 giờ 20 phút
Pull request đã merge (30 ngày)
117

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/servers

Tất cả issue của modelcontextprotocol/servers

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.