Skip to content

Commit efecda0

Browse files
authored
Merge pull request modelcontextprotocol#2516 from modelcontextprotocol/claude/add-deterministic-tools-spec-mWwaa
spec: tools/list SHOULD return tools in deterministic order
2 parents 74aaeae + 91e1f9e commit efecda0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

docs/specification/draft/changelog.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ N/A
1515

1616
1. Add `extensions` field to `ClientCapabilities` and `ServerCapabilities` to support optional [extensions](/docs/extensions/overview) beyond the core protocol.
1717
2. Document OpenTelemetry trace context propagation conventions for `_meta` keys (`traceparent`, `tracestate`, `baggage`) ([SEP-414](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/414)).
18+
3. Servers **SHOULD** return tools from `tools/list` in a deterministic order to enable client-side caching and improve LLM prompt cache hit rates.
1819

1920
## Other schema changes
2021

docs/specification/draft/server/tools.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ with the set of tools currently available to the requesting client. This set **M
5555
empty and **MAY** change over the lifetime of the connection (see
5656
[List Changed Notification](#list-changed-notification)).
5757

58+
Servers **SHOULD** return tools in a deterministic order (i.e., the same ordering across
59+
requests when the underlying set of tools has not changed). Deterministic ordering enables
60+
clients to reliably cache the tool list and improves LLM prompt cache hit rates when tools
61+
are included in model context.
62+
5863
## Protocol Messages
5964

6065
### Listing Tools

0 commit comments

Comments
 (0)