zuplo 7.14.8 → 7.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +5 -78
- package/README.md +17 -0
- package/docs/articles/logging.mdx +8 -1
- package/docs/articles/opentelemetry.mdx +269 -0
- package/docs/concepts/project-structure.mdx +1 -1
- package/docs/handlers/mcp-server.mdx +82 -2
- package/docs/mcp-gateway/auth/upstream-oauth.mdx +50 -8
- package/docs/mcp-gateway/code-config/compatibility-dates.mdx +96 -0
- package/docs/mcp-gateway/code-config/mcp-proxy-handler.mdx +22 -0
- package/docs/mcp-gateway/how-it-works.mdx +21 -2
- package/docs/mcp-gateway/observability/logging.mdx +25 -1
- package/docs/mcp-gateway/reference.mdx +86 -5
- package/docs/mcp-gateway/troubleshooting.mdx +5 -1
- package/docs/mcp-server/flat-tool-input.mdx +578 -0
- package/docs/mcp-server/prompts.mdx +10 -0
- package/docs/mcp-server/resources.mdx +58 -1
- package/docs/mcp-server/tools.mdx +132 -93
- package/docs/mcp-server/troubleshooting.mdx +184 -13
- package/docs/programmable-api/compatibility-dates.mdx +262 -3
- package/docs/programmable-api/logger.mdx +3 -0
- package/docs/programmable-api/runtime-extensions.mdx +14 -0
- package/docs/programmable-api/telemetry-redaction.mdx +308 -0
- package/docs/programmable-api/zuplo-json.mdx +2 -2
- package/package.json +6 -6
|
@@ -165,91 +165,102 @@ Zuplo derives each tool's `inputSchema` from the operation's OpenAPI definition.
|
|
|
165
165
|
The `toolInputStyle` setting decides its shape:
|
|
166
166
|
|
|
167
167
|
- `nested` (default) - Each input channel the operation declares is its own
|
|
168
|
-
object argument: `
|
|
169
|
-
- `flat` - The
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
object argument: `pathParams`, `queryParams`, `body`, or `headers`.
|
|
169
|
+
- `flat` - The operation's path, query, and header parameters and the request
|
|
170
|
+
body's properties all become top-level tool arguments.
|
|
171
|
+
|
|
172
|
+
Some models, particularly less capable ones, send a body's fields at the top
|
|
173
|
+
level even when the tool advertises them under `body`. Against a nested schema,
|
|
174
|
+
that first call fails validation and the model retries with the wrapper, which
|
|
175
|
+
costs a round trip on every call. Flat input removes the wrapper. MCP doesn't
|
|
176
|
+
require either shape, and capable models generally follow whatever schema a tool
|
|
177
|
+
advertises, so `flat` is opt-in.
|
|
172
178
|
|
|
173
179
|
Set `toolInputStyle` in the
|
|
174
180
|
[handler options](../handlers/mcp-server.mdx#configuration) to choose the style
|
|
175
|
-
for every tool on the server
|
|
176
|
-
[Set the input style per tool](#set-the-input-style-per-tool).
|
|
177
|
-
|
|
178
|
-
When a client calls a flat tool, the gateway routes each argument back to the
|
|
179
|
-
channel it came from, so a body field lands in the request body and a query
|
|
180
|
-
parameter lands in the URL.
|
|
181
|
-
|
|
182
|
-
The weather route above declares one required query parameter, so its flat tool
|
|
183
|
-
takes one required argument:
|
|
181
|
+
for every tool on the server:
|
|
184
182
|
|
|
185
183
|
```json
|
|
186
|
-
{
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"location": {
|
|
190
|
-
"type": "string"
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
"required": ["location"],
|
|
194
|
-
"additionalProperties": false
|
|
184
|
+
"options": {
|
|
185
|
+
"toolInputStyle": "flat",
|
|
186
|
+
"operations": [{ "file": "./config/routes.oas.json", "id": "searchProducts" }]
|
|
195
187
|
}
|
|
196
188
|
```
|
|
197
189
|
|
|
198
|
-
|
|
199
|
-
|
|
190
|
+
To give one tool a different style, see
|
|
191
|
+
[Set the input style per tool](#set-the-input-style-per-tool). The default is
|
|
192
|
+
`nested` on every compatibility date.
|
|
200
193
|
|
|
201
|
-
|
|
194
|
+
For example, `POST /stores/{storeId}/search` declares a path parameter
|
|
195
|
+
`storeId`, an optional query parameter `limit`, a required header `x-tenant`,
|
|
196
|
+
and a JSON body with a required `query` and an optional `sort`. The two styles
|
|
197
|
+
advertise these schemas (each property's schema shortened):
|
|
198
|
+
|
|
199
|
+
```json title="nested"
|
|
202
200
|
{
|
|
203
|
-
"
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
"
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"pathParams": {
|
|
204
|
+
"type": "object",
|
|
205
|
+
"properties": { "storeId": {} },
|
|
206
|
+
"required": ["storeId"]
|
|
207
|
+
},
|
|
208
|
+
"queryParams": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": { "limit": {} },
|
|
211
|
+
"required": []
|
|
212
|
+
},
|
|
213
|
+
"body": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"properties": { "query": {}, "sort": {} },
|
|
216
|
+
"required": ["query"]
|
|
217
|
+
},
|
|
218
|
+
"headers": {
|
|
219
|
+
"type": "object",
|
|
220
|
+
"properties": { "x-tenant": {} },
|
|
221
|
+
"required": ["x-tenant"]
|
|
222
222
|
}
|
|
223
|
-
}
|
|
223
|
+
},
|
|
224
|
+
"required": ["pathParams", "queryParams", "body", "headers"]
|
|
224
225
|
}
|
|
225
226
|
```
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
```json
|
|
228
|
+
```json title="flat"
|
|
230
229
|
{
|
|
231
230
|
"type": "object",
|
|
232
231
|
"properties": {
|
|
233
|
-
"
|
|
234
|
-
"
|
|
232
|
+
"storeId": {},
|
|
233
|
+
"limit": {},
|
|
234
|
+
"query": {},
|
|
235
|
+
"sort": {},
|
|
236
|
+
"x-tenant": {}
|
|
235
237
|
},
|
|
236
|
-
"required": ["
|
|
237
|
-
"additionalProperties": false
|
|
238
|
+
"required": ["storeId", "query", "x-tenant"]
|
|
238
239
|
}
|
|
239
240
|
```
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
A flat call passes every argument at the top level:
|
|
242
243
|
|
|
243
244
|
```json
|
|
244
245
|
{
|
|
245
|
-
"name": "
|
|
246
|
+
"name": "searchProducts",
|
|
246
247
|
"arguments": {
|
|
247
|
-
"
|
|
248
|
-
"
|
|
248
|
+
"storeId": "s1",
|
|
249
|
+
"limit": 10,
|
|
250
|
+
"query": "hoodie",
|
|
251
|
+
"x-tenant": "acme"
|
|
249
252
|
}
|
|
250
253
|
}
|
|
251
254
|
```
|
|
252
255
|
|
|
256
|
+
The gateway routes each argument back to the channel that declared it, so the
|
|
257
|
+
route receives `POST /stores/s1/search?limit=10` with the header
|
|
258
|
+
`x-tenant: acme` and the body `{"query":"hoodie"}`. That's the same request the
|
|
259
|
+
equivalent nested call produces.
|
|
260
|
+
|
|
261
|
+
For the full mapping rules, every case that keeps a tool nested, and the log and
|
|
262
|
+
build messages, see [Flat tool input](./flat-tool-input.mdx).
|
|
263
|
+
|
|
253
264
|
:::note
|
|
254
265
|
|
|
255
266
|
Parameters declared with `in: cookie` aren't exposed as tool arguments.
|
|
@@ -262,7 +273,7 @@ Your own OpenAPI schema decides whether an argument the tool doesn't declare is
|
|
|
262
273
|
rejected:
|
|
263
274
|
|
|
264
275
|
- **The schema sets `additionalProperties: false`.** The tool's flat schema is
|
|
265
|
-
closed too, and an undeclared argument fails
|
|
276
|
+
closed too, and an undeclared argument fails as an invalid-arguments error.
|
|
266
277
|
- **The schema omits `additionalProperties`.** JSON Schema permits extras, so
|
|
267
278
|
the tool accepts the argument and forwards it in the request body.
|
|
268
279
|
|
|
@@ -274,38 +285,33 @@ that exact name. An undeclared argument never becomes an upstream header.
|
|
|
274
285
|
|
|
275
286
|
### When arguments stay nested
|
|
276
287
|
|
|
277
|
-
Some operations can't be flattened without changing what the tool accepts
|
|
278
|
-
tools keep the nested shape even when `toolInputStyle` is `flat`, and the MCP
|
|
279
|
-
server logs the reason when it registers the tool:
|
|
288
|
+
Some operations can't be flattened without changing what the tool accepts:
|
|
280
289
|
|
|
281
290
|
- **Two channels declare the same name.** A `limit` query parameter alongside a
|
|
282
|
-
`limit` body field, for example.
|
|
283
|
-
logs a warning. Rename one of them to get flat arguments.
|
|
291
|
+
`limit` body field, for example. Rename one of them to get flat arguments.
|
|
284
292
|
- **The request body isn't a plain object.** An array, a string, or a body built
|
|
285
|
-
from `oneOf
|
|
286
|
-
|
|
287
|
-
`patternProperties
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
```
|
|
293
|
+
from `oneOf` or `anyOf` has no property names to hoist. Neither does one that
|
|
294
|
+
constrains the object as a whole, such as with `minProperties` or
|
|
295
|
+
`patternProperties`.
|
|
296
|
+
|
|
297
|
+
From
|
|
298
|
+
[compatibility date `2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06),
|
|
299
|
+
a tool whose `toolInputStyle` is `flat` and that can't be fully flattened fails
|
|
300
|
+
the build. The error names the tool, the operation, and the cause. Change the
|
|
301
|
+
schema so it flattens, or set `"toolInputStyle": "nested"` on that tool. A root
|
|
302
|
+
`allOf` of plain object schemas and a `dependentRequired` that names only body
|
|
303
|
+
properties also flatten from this date.
|
|
304
|
+
|
|
305
|
+
On earlier compatibility dates, those tools keep part or all of the nested shape
|
|
306
|
+
even when `toolInputStyle` is `flat`, and the MCP server logs the reason when it
|
|
307
|
+
registers the tool. With a name collision, the whole schema stays nested and the
|
|
308
|
+
server logs a warning. With a body that isn't a plain object, the parameters
|
|
309
|
+
still flatten and the body keeps its own `body` argument. Enable
|
|
310
|
+
[`debugMode`](../handlers/mcp-server.mdx#configuration) to see which tools this
|
|
311
|
+
applies to.
|
|
312
|
+
|
|
313
|
+
See [Flat tool input](./flat-tool-input.mdx#when-the-body-stays-under-body) for
|
|
314
|
+
the full list of body shapes and the exact build errors.
|
|
309
315
|
|
|
310
316
|
The channel names are `body`, `queryParams`, `pathParams`, and `headers`. Only
|
|
311
317
|
the channels the operation declares appear.
|
|
@@ -317,14 +323,18 @@ schema keeps working:
|
|
|
317
323
|
|
|
318
324
|
```json
|
|
319
325
|
{
|
|
320
|
-
"name": "
|
|
326
|
+
"name": "searchProducts",
|
|
321
327
|
"arguments": {
|
|
322
|
-
"
|
|
328
|
+
"pathParams": { "storeId": "s1" },
|
|
329
|
+
"queryParams": { "limit": 10 },
|
|
330
|
+
"body": { "query": "hoodie" },
|
|
331
|
+
"headers": { "x-tenant": "acme" }
|
|
323
332
|
}
|
|
324
333
|
}
|
|
325
334
|
```
|
|
326
335
|
|
|
327
|
-
Send flat arguments in new clients — that's what a flat tool advertises.
|
|
336
|
+
Send flat arguments in new clients — that's what a flat tool advertises. A call
|
|
337
|
+
that mixes the two forms is read as flat.
|
|
328
338
|
|
|
329
339
|
:::note
|
|
330
340
|
|
|
@@ -359,15 +369,44 @@ so switching one tool to `flat` doesn't break existing callers. Only that tool's
|
|
|
359
369
|
advertised `inputSchema` changes.
|
|
360
370
|
|
|
361
371
|
`toolInputStyle` accepts only `"flat"` or `"nested"`. The build rejects any
|
|
362
|
-
other value in `x-zuplo-route.mcp`.
|
|
363
|
-
|
|
372
|
+
other value in `x-zuplo-route.mcp`. On the handler, any other value is read as
|
|
373
|
+
`nested` without an error.
|
|
374
|
+
|
|
375
|
+
If your MCP server still uses the deprecated `files` option, set
|
|
376
|
+
`toolInputStyle` in the operation's `x-zuplo-mcp-tool` extension instead. The
|
|
377
|
+
MCP server checks that value when it registers the tool and throws an error that
|
|
378
|
+
names the operation:
|
|
364
379
|
|
|
365
380
|
```
|
|
366
381
|
MCP tool configuration error: invalid toolInputStyle "Flat" on operation "createOrder". Use "flat" or "nested".
|
|
367
382
|
```
|
|
368
383
|
|
|
369
|
-
|
|
370
|
-
`
|
|
384
|
+
From compatibility date
|
|
385
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06),
|
|
386
|
+
`toolInputStyle` must be a literal value on the handler and on every tool. A
|
|
387
|
+
`$env(...)` value fails the build.
|
|
388
|
+
|
|
389
|
+
## Parameter serialization
|
|
390
|
+
|
|
391
|
+
From compatibility date
|
|
392
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06), the MCP
|
|
393
|
+
Server handler writes path, query, and header arguments into the request using
|
|
394
|
+
each parameter's OpenAPI `style`, `explode`, `allowReserved`, and `content`.
|
|
395
|
+
Before that date it uses one fixed encoding per location, so a route that
|
|
396
|
+
declares a style such as `deepObject`, `pipeDelimited`, `label`, or `matrix` may
|
|
397
|
+
receive a value it can't parse.
|
|
398
|
+
|
|
399
|
+
```text
|
|
400
|
+
Query parameter rgb: { style: deepObject, explode: true }
|
|
401
|
+
Arguments { "rgb": { "R": 100, "G": 200, "B": 150 } }
|
|
402
|
+
|
|
403
|
+
Before 2026-11-06 GET /swatches?rgb=%7B%22R%22%3A100%2C%22G%22%3A200%2C%22B%22%3A150%7D
|
|
404
|
+
From 2026-11-06 GET /swatches?rgb[R]=100&rgb[G]=200&rgb[B]=150
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Tool names follow the same rule set from that date: names that don't match the
|
|
408
|
+
MCP tool naming rule are rewritten. See
|
|
409
|
+
[Build warning: tool name doesn't follow the MCP tool naming rule](./troubleshooting.mdx#build-warning-tool-name-doesnt-follow-the-mcp-tool-naming-rule).
|
|
371
410
|
|
|
372
411
|
## Track tool calls with runtime hooks
|
|
373
412
|
|
|
@@ -152,16 +152,66 @@ For the full definitions of both options, see the
|
|
|
152
152
|
[MCP `2025-06-18` Global Options](../handlers/mcp-server.mdx#mcp-2025-06-18-global-options)
|
|
153
153
|
in the handler reference.
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
### Fields missing for clients on older protocol versions
|
|
156
|
+
|
|
157
|
+
From compatibility date
|
|
158
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06), the
|
|
159
|
+
handler leaves out of each response the fields that protocol revisions newer
|
|
160
|
+
than the client's added. The request's `MCP-Protocol-Version` header decides the
|
|
161
|
+
version, and a request without the header counts as `2025-03-26`:
|
|
162
|
+
|
|
163
|
+
| Client's protocol version | Fields the handler leaves out |
|
|
164
|
+
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
165
|
+
| Before `2025-06-18` | `outputSchema` and `title` on tools, `title` on resources, `structuredContent` on `tools/call` results, and `lastModified` on content annotations. A `resource_link` block becomes a text block of JSON. |
|
|
166
|
+
| Before `2025-11-25` | `icons` and `execution` on tools, and `icons` on resources and resource links |
|
|
167
|
+
| Before `2025-03-26` | `annotations` on tools |
|
|
168
|
+
|
|
169
|
+
When a `tools/call` result has `structuredContent` but no text block, an older
|
|
170
|
+
client receives the JSON as a text block instead. `_meta` is sent on every
|
|
171
|
+
version.
|
|
172
|
+
|
|
173
|
+
So if a client doesn't receive the `outputSchema` or `structuredContent` that
|
|
174
|
+
`includeOutputSchema` and `includeStructuredContent` turn on, check the
|
|
175
|
+
`MCP-Protocol-Version` header the client sends. The client must send
|
|
176
|
+
`2025-06-18` or later to receive them. See
|
|
177
|
+
[Compatibility dates](../programmable-api/compatibility-dates.mdx#2026-11-06).
|
|
178
|
+
|
|
179
|
+
## Invalid arguments for tool
|
|
180
|
+
|
|
181
|
+
**Symptom.** A tool call fails with a message that starts
|
|
182
|
+
`Invalid arguments for tool '<name>':` and names an argument. How the failure
|
|
183
|
+
reaches the client depends on the `MCP-Protocol-Version` header the client
|
|
184
|
+
sends:
|
|
185
|
+
|
|
186
|
+
- **`2025-11-25`** — the call returns a tool result with `isError: true` and the
|
|
187
|
+
message as its only text content. The model reads the message and can retry
|
|
188
|
+
with corrected arguments.
|
|
189
|
+
- **`2025-06-18` or earlier, or no header** — the call fails with JSON-RPC error
|
|
190
|
+
`-32602` and the message. `error.data` carries the validation details when
|
|
191
|
+
there are any.
|
|
192
|
+
|
|
193
|
+
Either way, the HTTP status is `200` and the tool doesn't run, so no request
|
|
194
|
+
reaches the route behind it. For example, on `2025-11-25`:
|
|
156
195
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"jsonrpc": "2.0",
|
|
199
|
+
"id": 1,
|
|
200
|
+
"result": {
|
|
201
|
+
"content": [
|
|
202
|
+
{
|
|
203
|
+
"type": "text",
|
|
204
|
+
"text": "Invalid arguments for tool 'create_order': must NOT have additional properties (sku)"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"isError": true
|
|
208
|
+
}
|
|
209
|
+
}
|
|
163
210
|
```
|
|
164
211
|
|
|
212
|
+
The text after the colon describes each failed check. Its exact wording depends
|
|
213
|
+
on your project's compatibility date.
|
|
214
|
+
|
|
165
215
|
**Likely cause 1: the argument isn't in the schema.** The request body schema
|
|
166
216
|
backing the tool sets `additionalProperties: false`, so the tool's input schema
|
|
167
217
|
is closed and an argument it doesn't declare is invalid. Read the tool's
|
|
@@ -172,26 +222,147 @@ invents a field name lands here.
|
|
|
172
222
|
arguments when its [`toolInputStyle`](./tools.mdx#tool-input-schemas) is
|
|
173
223
|
`nested`, which is the default, or when its OpenAPI can't be flattened. Its
|
|
174
224
|
arguments sit under `body`, `queryParams`, `pathParams`, or `headers`. When the
|
|
175
|
-
|
|
225
|
+
message reports a missing `body`, the caller sent flat arguments to a nested
|
|
226
|
+
tool:
|
|
176
227
|
|
|
177
228
|
```
|
|
178
|
-
|
|
179
|
-
✖ Invalid input: expected object, received undefined
|
|
180
|
-
→ at body
|
|
229
|
+
Invalid arguments for tool 'create_order': must have required property 'body'
|
|
181
230
|
```
|
|
182
231
|
|
|
183
232
|
When a `flat` tool still advertises nested arguments, the MCP server logs why
|
|
184
233
|
when it registers the tool: a name collision between two input channels (logged
|
|
185
234
|
as a warning), or a request body that isn't a plain object (logged at debug
|
|
186
|
-
level — enable `debugMode` to see it).
|
|
235
|
+
level — enable `debugMode` to see it). From compatibility date
|
|
236
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06), both
|
|
237
|
+
cases fail the build instead. See
|
|
187
238
|
[When arguments stay nested](./tools.mdx#when-arguments-stay-nested) for both
|
|
188
|
-
cases and how to resolve
|
|
239
|
+
cases and how to resolve them.
|
|
189
240
|
|
|
190
241
|
**Fix.** Always craft `arguments` against the `inputSchema` the tool advertises
|
|
191
242
|
in `tools/list` rather than assuming a shape. The
|
|
192
243
|
[MCP Inspector](#client-side-debugging-tools) shows both the schema and the
|
|
193
244
|
error for a call.
|
|
194
245
|
|
|
246
|
+
## Build warning: tool name doesn't follow the MCP tool naming rule
|
|
247
|
+
|
|
248
|
+
**Symptom.** The build log shows a warning such as:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
MCP tool name "search items/v2" on route POST /mcp does not follow the MCP tool naming rule
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Or, when two tools share a name:
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
MCP tool name "duplicate_name" is used by more than one tool on route POST /mcp
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Likely cause.** MCP tool names should be 1 to 128 characters of `A-Z`, `a-z`,
|
|
261
|
+
`0-9`, `_`, `-`, and `.`, and unique within a server. A tool's name comes from
|
|
262
|
+
`x-zuplo-route.mcp.name` or, when that's not set, the operation's `operationId`.
|
|
263
|
+
Names with spaces, `/`, or non-ASCII characters break the rule, and clients that
|
|
264
|
+
enforce it reject or rename those tools. The build warns about every such name,
|
|
265
|
+
whatever your compatibility date.
|
|
266
|
+
|
|
267
|
+
What the handler does with the name depends on your compatibility date:
|
|
268
|
+
|
|
269
|
+
- **Before
|
|
270
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06)** — the
|
|
271
|
+
handler advertises each tool under its name as is. When two tools share a
|
|
272
|
+
name, the later one replaces the earlier one.
|
|
273
|
+
- **From `2026-11-06`** — the handler rewrites each name that breaks the rule:
|
|
274
|
+
every character outside the allowed set becomes `_`, an empty name becomes
|
|
275
|
+
`tool`, and the name is cut to 128 characters. A rewritten or repeated name
|
|
276
|
+
that's already taken gets a `_2`, `_3`, and so on suffix, so both tools stay
|
|
277
|
+
available. For example, `search items/v2` becomes `search_items_v2`, or
|
|
278
|
+
`search_items_v2_2` when another tool already uses `search_items_v2`.
|
|
279
|
+
|
|
280
|
+
From compatibility date `2026-11-06`, `tools/list` and `tools/call` use the
|
|
281
|
+
rewritten name, and `tools/call` no longer accepts the old name. A client or
|
|
282
|
+
prompt that calls a tool by its old name gets a `Tool "<name>" not found` error
|
|
283
|
+
(`-32602`) after you move to the new compatibility date.
|
|
284
|
+
|
|
285
|
+
**Fix.** Set `x-zuplo-route.mcp.name` on each operation the warning names to a
|
|
286
|
+
unique name that follows the rule. The name then stays the same on every
|
|
287
|
+
compatibility date. See [MCP Server tools](./tools.mdx) for the `mcp` route
|
|
288
|
+
options and
|
|
289
|
+
[Compatibility dates](../programmable-api/compatibility-dates.mdx#2026-11-06)
|
|
290
|
+
for the change.
|
|
291
|
+
|
|
292
|
+
## JSON-RPC errors the handler returns
|
|
293
|
+
|
|
294
|
+
The MCP Server handler answers protocol mistakes with the JSON-RPC error codes
|
|
295
|
+
that JSON-RPC 2.0 and the MCP specification assign. On `2025-11-25` and earlier,
|
|
296
|
+
every error message is a single line. When the handler can't read the request's
|
|
297
|
+
`id`, the error has no `id`. The table lists the answers on `2025-11-25` and
|
|
298
|
+
earlier; see [JSON-RPC errors on `2026-07-28`](#json-rpc-errors-on-2026-07-28)
|
|
299
|
+
for that revision.
|
|
300
|
+
|
|
301
|
+
| Code | HTTP status | Meaning |
|
|
302
|
+
| -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
303
|
+
| `-32700` | `400` | Parse error: the body isn't valid JSON. |
|
|
304
|
+
| `-32600` | `400` | Invalid request: valid JSON that isn't a JSON-RPC request (for example, no `method`, or `jsonrpc` isn't `"2.0"`), an empty batch, or a refused batch. |
|
|
305
|
+
| `-32601` | `200` | Method not found: the handler doesn't serve the method. |
|
|
306
|
+
| `-32602` | `200` | Invalid params: a missing or mistyped param, an unknown tool or prompt name, a list `cursor` (the handler never returns `nextCursor`), or invalid tool arguments before `2025-11-25`. |
|
|
307
|
+
| `-32002` | `200` | Resource not found: `resources/read` of a URI that no resource uses. `error.data.uri` holds the requested URI. |
|
|
308
|
+
| `-32603` | `200` | Internal error: the handler failed while it served a valid request, such as a resource route that throws. |
|
|
309
|
+
| `-32000` | `4xx` | Transport error: `405` for an unserved HTTP method, `406` for a missing `Accept` type, `415` for a non-JSON `Content-Type`, and `400` for an unsupported `MCP-Protocol-Version`. |
|
|
310
|
+
|
|
311
|
+
The handler accepts `MCP-Protocol-Version` values `2024-10-07`, `2024-11-05`,
|
|
312
|
+
`2025-03-26`, `2025-06-18`, and `2025-11-25`, and `2026-07-28` from
|
|
313
|
+
compatibility date
|
|
314
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06). A
|
|
315
|
+
request without the header counts as `2025-03-26`. Any other value gets HTTP
|
|
316
|
+
`400` and `-32000`, and so does `2026-07-28` on an earlier compatibility date.
|
|
317
|
+
|
|
318
|
+
### JSON-RPC batches
|
|
319
|
+
|
|
320
|
+
A JSON-RPC batch sends several requests as one JSON array. MCP removed batches
|
|
321
|
+
in protocol version `2025-06-18`, so the handler serves a batch only when the
|
|
322
|
+
request's `MCP-Protocol-Version` header is `2025-03-26` or earlier, or when the
|
|
323
|
+
header is missing. On `2025-06-18` or later, the handler refuses the whole batch
|
|
324
|
+
and runs none of it:
|
|
325
|
+
|
|
326
|
+
```json
|
|
327
|
+
{
|
|
328
|
+
"jsonrpc": "2.0",
|
|
329
|
+
"error": {
|
|
330
|
+
"code": -32600,
|
|
331
|
+
"message": "Invalid Request: protocol version 2025-11-25 does not support JSON-RPC batches"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
The response has HTTP status `400`. To fix it, send each request in its own HTTP
|
|
337
|
+
request. In a batch the handler serves, each invalid member gets its own
|
|
338
|
+
`-32600` error in its position and the valid members still run. A batch holds at
|
|
339
|
+
most 100 requests. From compatibility date
|
|
340
|
+
[`2026-11-06`](../programmable-api/compatibility-dates.mdx#2026-11-06), the
|
|
341
|
+
answer to a batch is always an array. On an earlier date, a batch whose answer
|
|
342
|
+
holds a single response gets that response as a bare object.
|
|
343
|
+
|
|
344
|
+
### JSON-RPC errors on `2026-07-28`
|
|
345
|
+
|
|
346
|
+
From compatibility date `2026-11-06`, a request whose `MCP-Protocol-Version`
|
|
347
|
+
header is `2026-07-28` gets these answers. A request that names `2026-07-28`
|
|
348
|
+
only in its `params._meta` envelope, without the header, gets HTTP `400` with
|
|
349
|
+
`-32020`, because `2026-07-28` requires the header. A request whose `_meta`
|
|
350
|
+
names `2025-11-25` or an earlier revision, without a `2026-07-28` header, is
|
|
351
|
+
served on that revision and gets the answers in the table above.
|
|
352
|
+
|
|
353
|
+
| Code | HTTP status | Meaning |
|
|
354
|
+
| -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
355
|
+
| `-32602` | `400` | Missing envelope: `params._meta` is missing or malformed. |
|
|
356
|
+
| `-32020` | `400` | Header mismatch: the `MCP-Protocol-Version`, `Mcp-Method`, or `Mcp-Name` header is missing or disagrees with the body. |
|
|
357
|
+
| `-32022` | `400` | Unsupported revision: the request names a revision the handler doesn't serve. `error.data.supported` lists `2026-07-28`, then `2025-11-25` through `2024-10-07`. |
|
|
358
|
+
| `-32601` | `404` | Method not found: `2026-07-28` removed `initialize`, `ping`, `logging/setLevel`, `resources/subscribe`, and `resources/unsubscribe`. |
|
|
359
|
+
| `-32600` | `400` | Invalid request: a JSON-RPC batch or a posted JSON-RPC response. `2026-07-28` has neither, so the handler runs none of it. |
|
|
360
|
+
| `-32600` | `406`, `415` | Transport error: an `Accept` header that doesn't allow `application/json` (`406`), or a non-JSON `Content-Type` (`415`). On `2025-11-25` and earlier, these carry `-32000`. |
|
|
361
|
+
| `-32602` | `200` | Invalid params: a missing or mistyped param, a list `cursor`, an unknown tool (`Tool <name> not found`), an unknown prompt (`Prompt <name> not found`), or an unknown resource (`Resource not found: <uri>`, with `error.data.uri`). |
|
|
362
|
+
|
|
363
|
+
An unknown resource gets `-32602` on `2026-07-28`, not `-32002`. A notification
|
|
364
|
+
gets HTTP `202` with no body.
|
|
365
|
+
|
|
195
366
|
## Client-side debugging tools
|
|
196
367
|
|
|
197
368
|
When the gateway looks healthy, reproduce the failure against the client to see
|