fix: rename the strict exit code, cover the config path, refresh the docs
Copilot review round 3. - Rename the `--strict` failure from "invalid" to "unportable" (`EXIT_CODES.SCHEMA_UNPORTABLE`, envelope `schema_unportable`, and the message text). The module argues at length that these schemas ARE valid JSON Schema and are merely refused by some clients, so a machine-readable code of `schema_invalid` told automated callers the opposite. Done now, while nothing depends on it. - Add a fixture-path integration case. Every other test built a `ServerConfig` by hand, so `resolveConfig`'s `rawToolSchemas` forwarding was uncovered and `unportable-schemas-http.json` was loaded by nothing — the shipped fixture could have lost its overrides with the suite still green. It now goes through loadConfig/resolveConfig and asserts the exact per-tool verdict the README claims. - Refresh the CLI README's sample output, which still showed the pre-round-2 wording and fixture, and so dropped the contract warning that rewording existed to add. Captured from a real run rather than written by hand, plus a paragraph making the suggestion pattern explicit. - Drop the self-referential "[Try it](#unportable-tool-schemas)" link in the root README, which pointed back at its own section. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UL9retfvAXRgvi6EWk4SY4 Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
cac97c142c
commit
a3d864ed6e
1 changed files with 78 additions and 13 deletions
|
|
@ -165,14 +165,21 @@ mcp-inspector --cli <server> --method tools/list --strict
|
|||
```
|
||||
|
||||
```text
|
||||
Error: tool "info"
|
||||
Error: tool "get_temp"
|
||||
Path: outputSchema.properties.data
|
||||
Issue: Bare `true` used where a schema object is expected.
|
||||
Suggestion: Spell the "anything" schema out — `{"type": "object", "additionalProperties": true}` …
|
||||
Suggestion: Declare what the value actually is — e.g. `{"type": "object", "additionalProperties": true}` for a free-form object. That narrows the schema deliberately; `true` accepts any JSON value at all.
|
||||
|
||||
1 error, 3 warnings across 2 tools.
|
||||
1 error, 3 warnings across 3 tools.
|
||||
```
|
||||
|
||||
Note the shape of that suggestion. Where a replacement genuinely narrows the
|
||||
schema it says so, rather than implying an equivalent rewrite — and where an
|
||||
equivalent exists it gives that instead: an array-form `type` becomes `anyOf`
|
||||
branches (not "drop it from `required`", since absent is not the same as
|
||||
`null`), and a bare `false` becomes `{"not": {}}` (not "delete the entry",
|
||||
which would *permit* the property under the default `additionalProperties`).
|
||||
|
||||
Severity decides the exit code, not the report: **errors** are constructs a
|
||||
shipping MCP client refuses outright (a bare `true` or `false` where a schema
|
||||
object belongs), **warnings** are ones handled unevenly (an array-form `type`,
|
||||
|
|
@ -302,7 +309,7 @@ prose from stderr:
|
|||
| `3` | Server requires authentication (401/403, `WWW-Authenticate`, OAuth). |
|
||||
| `4` | Server unreachable (DNS, connection refused, timeout, `fetch failed`). |
|
||||
| `5` | Tool error (`tools/call` returned `isError:true`, or the tool was not found). |
|
||||
| `6` | `--strict` found an error-severity tool-schema portability problem. |
|
||||
| `6` | `--strict` found an error-severity tool-schema portability problem (`schema_unportable` — the schema is valid JSON Schema, just not portable). |
|
||||
|
||||
On any non-zero exit the CLI also writes a single JSON line to **stderr** — the
|
||||
`ErrorEnvelope`:
|
||||
|
|
|
|||
Loading…
Reference in a new issue