| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…y down A placeholder-less resource template made the server serve nothing. `ReflectedElementLoader` wrapped the failure in a `ConfigurationException` and rethrew it, which aborted `Registry::load()` before any element was registered. Loading is lazy by default, so that ran while a request was being served: `tools/list` and `tools/call` answered `-32602` with the template's message, and since `load()` marks itself loaded only on success, every following request repeated it. The loader now logs the failure and skips that element, the way `Discoverer` already treats an attribute it cannot process. The bad template is the only thing missing; the rest of the registry stays servable, and a server-side configuration error stops being reported to the client as invalid params on unrelated calls. Applies to all four element types, which carried the same rethrow. The `ResourceTemplate` message now also says what to do about it: a URI without a placeholder addresses a single resource, so it belongs in `addResource()`. Fixes modelcontextprotocol#476.
| Back | FazBrowse Home | New Git URL |
Fixes #476.
A placeholder-less resource template made the server serve nothing. ReflectedElementLoader wrapped the failure in a ConfigurationException and rethrew it, which aborted Registry::load() before any element was registered. Loading is lazy by default, so that ran while a request was being served: tools/list and tools/call answered -32602 with the template's message, and since load() marks itself loaded only on success, every following request repeated it.
The loader now logs the failure and skips that element, the way Discoverer already treats an attribute it cannot process (Discoverer.php:300-310). The bad template is the only thing missing; the rest of the registry stays servable, and a server-side configuration error stops being reported to the client as invalid params on unrelated calls. All four element types carried the same rethrow, so all four change.
The ResourceTemplate message now also says what to do about it: a URI without a placeholder addresses a single resource, so it belongs in addResource().
Changed from the first revision
The first take validated the URI template in Builder::addResourceTemplate(). @chr-hertel pushed back on that, rightly: every schema invariant would end up mirrored in the builder alongside the value object that already owns it, and the ResourceTemplate::isValidUriTemplate() accessor existed only to make that mirroring possible. Both are gone. Nothing in Builder changed, and this revision fixes the reported path — the #[McpResourceTemplate] blast radius — rather than one doorway into it.