mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 20:14:31 +01:00
* craft-mcp-server: options for apps that report argument errors as tool results (#778)
Add `Options` (default = today's behaviour) and `Server::with_options`:
- `website_url`: sent as `serverInfo.websiteUrl` at `initialize`.
- `tool_errors_as_results`: a `tools/call` whose arguments fail the schema check, or whose tool
is unknown, returns a tool result with `isError: true` and the message as text, not -32602.
- `strict_request_ids`: a request id that is not a string or number gets -32600 with a null id.
`Info` is unchanged, so existing struct-literal callers still compile. Tests cover each option on
and off, and hostile input with all options on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-mcp-server: strict request ids also apply to the missing-method error (#778)
With strict_request_ids, a message without `method` echoed an object, array or
bool id in its -32600 reply. It now answers with a null id for any id that is
not a string or number, as the later strict check does. Valid ids, absent ids
and incoming responses behave as before.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3e82d1719c)