Add sanitizeToolName function to convert package names to OpenAI-compatible format that matches pattern ^[a-zA-Z0-9_-]+$. Removes @ symbols, replaces / with _, and replaces other invalid characters with _. This fixes the error: "Invalid 'tools[0].name': string does not match pattern" when loading tools in the playground chat interface. Example transformations: - @tpmjs/hello-helloWorldTool → tpmjs_hello-helloWorldTool - firecrawl-aisdk-scrapeTool → firecrawl-aisdk-scrapeTool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| playground | ||
| web | ||