Sergii Osadchyi
35332931bf
fix(mcp): read readOnlyHint from mcp 2.x snake_case annotations
...
mcp 2.0 renamed ToolAnnotations.readOnlyHint to read_only_hint; camelCase
survives only as a pydantic serialization alias, which is not applied to
attribute access. _annotation_read_only_hint() read the camelCase attribute
off the SDK object, so on mcp 2.x the hint was always None and every tool --
including honestly annotated read-only ones -- fell into the
"unknown = write-capable" branch.
With trust: untrusted that means the approval gate fires before every read
call (get_*, search_*, list_*), which is exactly the failure mode that
trains a user to click through the prompt without reading it, weakening the
gate on the writes it exists for.
Use mcp_field() for the object path (the helper already used across the MCP
client for this 1.x -> 2.x rename) and accept snake_case in the cache dict
too, for caches written by another client. Unknown still means
write-capable; only the field lookup changes.
Regression test covers the SDK 2.x model, both snake_case shapes, the 1.x
camelCase attribute and a snake_case cache dict.
2026-10-05 15:28:17 -07:00
..
2026-10-05 16:46:53 -05:00
2026-09-30 21:33:08 -04:00
2026-10-05 01:15:16 -07:00
2026-09-26 20:40:40 -05:00
2026-09-24 02:41:14 -05:00
2026-09-28 05:37:55 -07:00
2026-09-25 14:14:06 -04:00
2026-09-27 13:48:28 -05:00
2026-09-24 02:23:44 -04:00
2026-09-24 11:50:30 -04:00
2026-09-28 03:34:07 -07:00
2026-09-24 02:23:44 -04:00
2026-09-24 02:23:44 -04:00
2026-10-01 16:18:46 +05:30
2026-09-30 09:57:30 -05:00
2026-09-29 03:01:04 +05:30
2026-10-04 21:29:04 -07:00
2026-09-28 06:06:17 -07:00
2026-09-27 13:48:28 -05:00
2026-10-01 16:18:46 +05:30
2026-10-01 03:18:09 -05:00
2026-09-29 15:58:55 +05:30
2026-09-29 15:58:55 +05:30
2026-10-05 16:42:57 -05:00
2026-10-02 22:54:53 -05:00
2026-10-02 11:06:58 -05:00
2026-09-27 23:53:40 -07:00
2026-09-24 01:55:51 -04:00
2026-09-29 14:12:41 -04:00
2026-09-29 14:12:41 -04:00
2026-09-24 01:55:51 -04:00
2026-09-24 01:55:51 -04:00
2026-09-29 18:33:44 +05:30
2026-09-29 19:44:05 -05:00
2026-09-27 00:56:31 +05:30
2026-09-28 06:42:00 -07:00
2026-09-29 15:58:55 +05:30
2026-09-27 00:56:31 +05:30
2026-09-27 00:56:31 +05:30
2026-09-28 10:11:33 -07:00
2026-09-24 06:15:21 -04:00
2026-10-02 20:30:25 -05:00
2026-10-03 16:56:51 +05:30
2026-10-02 01:18:03 +05:30
2026-09-28 05:28:05 -07:00
2026-09-28 05:28:05 -07:00
2026-10-03 16:31:09 +05:30
2026-09-26 23:44:55 +05:30
2026-10-05 16:40:38 -05:00
2026-09-27 18:17:20 +05:30
2026-10-02 20:24:30 -05:00
2026-10-02 21:49:36 -05:00
2026-10-02 01:24:41 +05:30
2026-10-01 01:53:55 -05:00
2026-09-24 06:08:20 -04:00
2026-10-02 21:43:34 -05:00
2026-09-26 17:34:46 -05:00
2026-09-28 03:34:07 -07:00
2026-09-28 04:34:30 -07:00
2026-09-26 18:27:10 -05:00
2026-09-29 12:25:29 -05:00
2026-10-05 16:46:53 -05:00
2026-09-27 01:10:56 +05:30
2026-10-02 01:15:39 +05:30
2026-10-02 21:47:39 -05:00
2026-09-25 14:14:06 -04:00
2026-09-27 01:10:56 +05:30
2026-09-27 02:39:29 +05:30
2026-09-26 23:44:55 +05:30
2026-10-04 05:13:55 -07:00
2026-10-02 01:15:39 +05:30
2026-10-04 00:08:20 -07:00
2026-10-05 01:15:16 -07:00
2026-10-01 16:22:28 +05:30
2026-10-02 01:18:03 +05:30
2026-10-01 16:22:28 +05:30
2026-10-02 20:24:01 -05:00
2026-09-29 16:47:48 +05:30
2026-10-04 00:08:20 -07:00
2026-09-29 18:49:11 -05:00
2026-09-23 21:55:59 -04:00
2026-10-05 16:42:57 -05:00
2026-09-28 05:24:26 -07:00
2026-10-04 00:08:20 -07:00
2026-10-03 10:26:12 -07:00
2026-09-26 22:40:54 +05:30
2026-09-27 21:30:10 -07:00
2026-09-29 15:58:55 +05:30
2026-09-29 15:58:55 +05:30
2026-09-29 15:58:55 +05:30
2026-09-26 22:40:54 +05:30
2026-10-03 09:38:33 -07:00
2026-09-28 19:02:20 +05:30
2026-10-04 12:42:25 -05:00
2026-10-05 16:47:32 -05:00
2026-10-05 15:28:17 -07:00
2026-09-26 20:58:16 -04:00
2026-10-02 20:24:20 -05:00
2026-09-26 23:44:55 +05:30
2026-09-29 02:06:58 +05:30
2026-10-03 23:05:48 -07:00
2026-09-24 04:38:23 -04:00
2026-09-28 11:29:49 -05:00
2026-09-30 10:32:09 -05:00
2026-09-26 16:51:19 -05:00
2026-09-25 14:58:09 -04:00
2026-09-25 13:49:31 -05:00
2026-10-03 09:38:33 -07:00
2026-10-03 09:43:03 -07:00
2026-10-05 00:23:05 -07:00
2026-09-30 23:07:09 -05:00
2026-09-26 17:19:34 -05:00
2026-10-03 10:52:57 -07:00
2026-10-05 14:35:39 -04:00
2026-09-28 05:37:55 -07:00
2026-10-05 14:35:39 -04:00
2026-10-01 00:52:58 -05:00
2026-10-03 17:03:54 -04:00
2026-10-05 16:42:57 -05:00
2026-09-24 03:52:03 -05:00
2026-10-05 20:08:11 +05:30
2026-09-29 12:25:29 -05:00
2026-09-26 22:26:05 +05:30
2026-10-04 13:18:57 -04:00
2026-10-04 00:08:20 -07:00
2026-10-04 00:08:20 -07:00
2026-09-24 03:42:38 -04:00
2026-09-24 16:49:18 +05:30
2026-09-24 07:39:33 -04:00
2026-09-30 23:05:43 -05:00
2026-09-30 23:10:24 -05:00
2026-09-27 00:19:50 +05:30
2026-09-29 20:57:45 -05:00
2026-09-25 14:24:56 -05:00
2026-10-04 02:54:56 +05:30
2026-09-29 02:06:58 +05:30
2026-09-29 15:28:19 -05:00
2026-09-26 06:20:21 +05:30
2026-10-03 16:30:40 +02:00
2026-10-05 20:08:11 +05:30
2026-09-29 15:58:55 +05:30
2026-10-02 22:42:55 -05:00
2026-09-29 17:29:05 +00:00
2026-09-29 22:07:30 +05:30
2026-09-27 01:29:25 -04:00
2026-10-05 16:40:15 -05:00
2026-09-27 03:45:07 -04:00
2026-10-05 12:37:46 -04:00
2026-10-02 18:35:34 -05:00
2026-09-26 06:19:34 +05:30
2026-09-26 06:19:34 +05:30
2026-09-30 23:02:33 -05:00
2026-09-28 12:23:25 -07:00
2026-10-05 16:42:22 -05:00
2026-09-26 06:19:34 +05:30
2026-09-28 12:33:01 -07:00
2026-09-28 14:16:18 -07:00
2026-09-26 06:19:34 +05:30
2026-10-02 18:35:45 -05:00
2026-09-29 19:14:28 -05:00
2026-09-29 19:14:28 -05:00
2026-10-04 00:10:54 +05:30
2026-10-02 18:58:06 -05:00
2026-10-04 00:10:54 +05:30
2026-10-02 21:12:48 -05:00
2026-10-03 23:43:03 -04:00
2026-09-24 11:50:30 -04:00
2026-10-05 20:08:11 +05:30
2026-09-28 04:34:30 -07:00