You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 18fb782
Browse filesBrowse the repository at this point in the historyBrowse files
authored
feat(inventory): add typed MCP tool registration foundation (#3371)
* feat(inventory): add typed MCP tool registration foundation
Use the MCP SDK's generic registration for concrete input/output types, with protocol-gated output schemas and structured results. Keep raw handlers compatible and apply shared middleware on both paths.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* chore: regenerate license files
Auto-generated by license-check workflow
* test: cover legacy typed CSV results
Exercise the typed array and object paths through an initialized 2025-11-25 MCP session. Verify CSV text is returned once without structured output or the SDK JSON fallback.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* feat(inventory): normalize legacy typed arguments
Add a raw JSON input normalizer that runs before SDK schema validation so migrated tools can retain legacy input coercions without widening their published schemas. Test case-folded issue states, numeric string IDs, validation failures and replacement registrations.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* chore: regenerate license files
Auto-generated by license-check workflow
* test(inventory): preserve typed input optionality
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): stabilize typed schema compatibility
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test(inventory): cover protocol isolation across clients
Exercise simultaneous legacy and modern sessions against one typed tool, plus stateless HTTP requests with modern, legacy, and absent protocol headers.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): harden typed schema registration contracts
Cache immutable schema variants and enum overrides, preserve runtime input compatibility and request-era output behavior, and normalize dynamic scope challenges before dispatch.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): cache warm schemas and guard typed preflight
Avoid repeated canonical schema serialization and header annotation for cache-owned immutable pointers while retaining content-based lookup for caller-owned schemas. Run typed authorization and availability middleware before preflight and preserve tool-result error semantics.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): preserve schema metadata isolation
Advertise the SDK-compatible object schema for typed any input and deep-clone mutable JSON Schema metadata before caching or deriving runtime variants. Add legacy/modern registration and mutation isolation coverage.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): detach numeric schema bounds and dedupe default traversal
Two Copilot findings on 431b7a2:
- CloneSchemas only deep-copies subschema nodes, so pointer-valued
numeric validation keywords (Minimum, Maximum, MinLength, MinItems,
etc.) remained aliased with the caller-owned schema after
CloneSchema/CachedSchema. A caller mutating one of those pointers
after caching could race with concurrent cached-schema
serialization or silently change the cached validation bounds.
Clone every *int/*float64 keyword explicitly alongside the existing
collection/metadata cloning.
- CloneSchemaWithoutDefaults's removeSchemaDefaults visited every
map/pointer child twice: once via two literal child-collection
loops, and again via schemaChildren, which already covers the same
fields. This doubled traversal at every nested level, making
default removal exponential for deeply nested object/array schemas.
Traverse only the single comprehensive schemaChildren list.
Add regression coverage across CloneSchema, CachedSchema, schema
inference option cloning, and CloneSchemaWithoutDefaults: every
*int/*float64 keyword is isolated from caller mutation (including
under concurrent marshaling), and a 48-level deep chain is used for
every schema-child field kind to confirm linear, non-exponential
default removal.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): gate typed output on supported protocol range
Select modern typed output for SDK-supported ISO-date protocol versions from 2026-07-28 onward. Missing, malformed, and unsupported future versions retain legacy behavior. Cover a later supported version through the selector list seam and verify the public path against the SDK supported set.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): unwrap pointer inputs before schema inference
Match SDK input inference by unwrapping one pointer level before the cached input key and inference. Preserve nullable output pointer schemas. Cover both public constructors with actual modern and legacy discovery and calls, including structured null output.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(inventory): reuse encoded schema cache for typed tools
Key output encodings by their source definitions while preserving the SDK-registered schema guard. Keep header routing metadata available for legacy and unknown protocol clients.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
0 commit comments