llm tools presets#3541
Conversation
- Added validation for the MCP_PRESET environment variable in `server.ts` to ensure only supported presets are accepted at startup, preventing silent misconfigurations. - Introduced a new preset registry in `presets.ts`, allowing for the management of LLM tool presets, with the initial implementation supporting only the 'legacy' preset. - Updated the Node SDK to expose preset-related functions (`getPreset`, `listPresets`, `DEFAULT_PRESET`) for easier access to preset information. - Created tests for preset validation and registry functionality, ensuring that unknown presets trigger appropriate errors and that the legacy preset behaves as expected. - Added corresponding Python SDK support for the preset registry, mirroring the Node implementation for consistency across languages.
|
@andrii-harbour please investigate these:
|
Three review findings from PR 3541:
1. Restore structured ToolCatalog.tools type. The refactor narrowed the
public catalog row to `unknown[]`, breaking TS consumers that read
tools[i].toolName etc. Move ToolCatalogEntry + ToolCatalogOperation
into presets.ts as public types and tighten the catalog signature.
2. Fail fast on malformed provider bundles. Node and Python preset
loaders previously coerced a missing or non-array `tools` field to
`[]`, hiding broken codegen output behind a silently empty tool
surface. Restore the pre-presets TOOLS_ASSET_INVALID throw at the
preset boundary.
3. Cross-lang parity for empty-string presets. Python choose_tools
treated `{'preset': ''}` as legacy via `or DEFAULT_PRESET`; Node and
MCP both raise PRESET_NOT_FOUND. Use an explicit None check so
Python matches.
Tests added covering structural catalog access, empty-string preset
fail-fast, and cross-lang parity for the empty-string case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in superdoc-sdk v1.15.0 |
|
🎉 This PR is included in @superdoc-dev/mcp v0.11.0 The release is available on GitHub release |
SD-3128