devtu-create-tool

Create new scientific tools for ToolUniverse framework with proper structure, validation, and testing. Use when users need to add tools to ToolUniverse, implement new API integrations, create tool wrappers for scientific databases/services, expand ToolUniverse capabilities, or follow ToolUniverse co

By mims-harvard · 380 installs

npx skills add mims-harvard/tooluniverse --skill devtu-create-tool

Source repository · Upstream listing

ToolUniverse Tool Creator Create new scientific tools following established patterns. Top 7 Mistakes (90% of Failures) 1. Missing default config.py Entry — tools silently won't load 2. Non nullable Mutually Exclusive Parameters — validation errors ( 1 issue in 2026) 3. Fake test examples — tests fail, agents get bad examples 4. Single level Testing — misses registration bugs 5. Skipping test new tools.py — misses schema/API issues 6. Tool Names 55 chars — breaks MCP compatibility 7. Raising Exceptions — should return error dicts instead Two Stage Architecture One class handles multiple operations. JSON defines individual wrappers. Need BOTH. Three Step Registration Step 1 : Class registration via @register tool("MyAPITool") Step 2 (MOST COMMONLY MISSED): Config registration in default config.py : Step 3 : Automatic wrapper generation on tu.load tools() Implementation Guide Files to Create src/tooluniverse/my api tool.py — implementation src/tooluniverse/data/my api tools.json — tool definitions tests/tools/test my api tool.py — tests Python Tool Class (Multi Operation Pattern) JSON Configuration Critical Requirements return schema MUST have oneOf : success + error schemas test examples MUST use real IDs : NO "TEST", "DUMMY", "PLACEHOLDER" Tool name <= 55 chars : {API} {action} {target} template Description 150 250 chars : what, format, example, notes NEVER raise in run() : return {"status": "error", "error": "..."} Set timeout on all HTTP requests (30s) Standard response : {"status": "success error", "data": {...}} Parameter Design Mutually Exclusive Parameters (CRITICAL — 1 issue) When tool accepts EITHER id OR name , BOTH must be nullable: Without "null" , validation fails when user provides only one parameter. Common cases: id OR name , gene id OR gene symbol , any optional filters. API Key Configuration Optional keys (tool works without, better with): Required keys (tool won't work without): Rules: Never add api key as tool parameter for optional keys. Use env vars only. Testing (MANDATORY) Full guide: [references/testing guide.md](references/testing guide.md) Quick Testing Checklist 1. Level 1 — Direct class test: import class, call run() , check response 2. Level 2 — ToolUniverse test: tu.tools.YourTool op1(...) , check registration 3. Level 3 — Real API test: use real IDs, verify actual responses 4. MANDATORY — Run python scripts/test new tools.py your tool v → 0 failures Verification Script Quick Commands References Testing guide : [references/testing guide.md](references/testing guide.md) Advanced patterns (async, SOAP, pagination): [references/advanced patterns.md](references/advanced patterns.md) Implementation guide (full checklist): [references/implementation guide.md](references/implementation guide.md) Tool improvement checklist : [references/tool improvement checklist.md](references/tool improvement checklist.md)