Repository navigation
Commit a2681c4
fix(fetch): emit inclusive minimum/maximum for max_length (modelcontextprotocol#1624)
The Fetch model bounded max_length with pydantic gt=0/lt=1000000, which
emits exclusiveMinimum/exclusiveMaximum in the tool's inputSchema. Gemini
(and other clients that accept only the OpenAPI 3.0 subset) reject those
keywords, so the fetch tool could not be declared at all. Use ge=1/le=999999
instead: the same accepted range for an int, emitted as minimum/maximum.
Ported from the max_length part of modelcontextprotocol#3812 by Dharit Shah. Its url-schema
change (dropping format: uri and minLength) is not part of this fix.
The protocol suite's tools/list assertion now expects minimum/maximum and
its KNOWN BUG modelcontextprotocol#1624 marker is gone; a new test pins that the edges 1 and
999999 are accepted, beside the existing 0 and 1000000 rejections.
Part of Wave 5 of modelcontextprotocol#5004.
Co-authored-by: Dharit Shah <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>1 parent 142bb84 commit a2681c4
2 files changed
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
174 | 177 | | |
175 | 178 | | |
176 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
137 | | - | |
138 | | - | |
| 136 | + | |
| 137 | + | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
| |||
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
187 | | - | |
| 186 | + | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
208 | 220 | | |
209 | 221 | | |
210 | 222 | | |
| |||
0 commit comments