| name | sw-kb-api |
| description | Query the SolidWorks knowledge-base catalog for categories, matching parts, complete published instructions, macros, known API errors, and lessons. Use after sw-pre-start and before any SolidWorks modeling or API work, for every part, assembly, drawing, repair, or model reproduction request. |
SolidWorks KB Lookup
Run $sw-pre-start first. Complete this lookup before CAD work.
Set KB_HOST from SW_KB_HOST; default to
https://sw-plugin.ideep.org. Use quoted curl shell calls only. Runtime
endpoints are public and use camelCase JSON.
1. Check health
curl -sS "{KB_HOST}/health"
If unreachable, tell the user Knowledge base is offline - proceeding without KB lookup, record the outage for session feedback, and continue from verified
engineering knowledge. Do not abort the CAD task.
2. Match a category
curl -sS "{KB_HOST}/api/categories"
Fuzzy-match the requested component against category name or slug. Save the
matching id as categoryId. If nothing matches, continue to the free-text
fallback in Step 4.
3. Match a part inside the category
curl -sS "{KB_HOST}/api/parts?categoryId={categoryId}&pageSize=100"
Optionally add a URL-encoded q parameter. Match active items by exact or close
partNumber, then by name. Save the best id as partId.
4. Load complete part detail
When partId is known:
curl -sS "{KB_HOST}/api/parts/{partId}"