Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/andrewbartels1/solidworksmcp-python/com-api-pitfallsgit clone --depth 1 https://github.com/andrewbartels1/SolidworksMCP-pythonWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.06513 |
| Opus 5 | $0.00000 | $0.03256 |
| Sonnet 5 | $0.00000 | $0.01303 |
| Haiku 4.5 | $0.00000 | $0.00651 |
Grade A, and why
com-api-pitfalls scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 584 lines — stays where its author put it; the contents beside it link to each section on GitHub.
COM API Pitfalls for LLM Agents
This page documents hard-won lessons from debugging the SolidWorks COM bridge. If you are an AI coding assistant (Claude, GPT-4, Gemini, Copilot, etc.) working on this codebase, read this page before touching any COM-related code. Every entry below caused a real runtime failure that required hours to diagnose.
!!! tip "For LLM agents" The patterns here are not obvious from the SolidWorks API docs alone. They are the delta between "what the documentation says" and "what actually works" under pywin32 late-binding on SW 2025/2026.
1. SelectByID2 — Callout must be VT_DISPATCH null, not None
Symptom: (-2147352571, 'Type mismatch.', None, 8) when calling SelectByID2.
Root cause: The Callout parameter (8th argument, type VT_DISPATCH) expects a COM
null pointer, not a Python None. Python None marshals as VT_NULL which SolidWorks
rejects with DISP_E_TYPEMISMATCH.
Fix:
import pythoncom
import win32com.client as _win32com
null_callout = _win32com.VARIANT(pythoncom.VT_DISPATCH, None)
model.Extension.SelectByID2(
"", "EDGE", x, y, z,
append, mark,
null_callout, # <- NOT plain None
0,
)
Applies to: Every call to SelectByID2 or SelectByID that doesn't need a real callout object.
The same issue occurs for FACE, EDGE, VERTEX, and other entity types.
2. InsertFeatureChamfer lives on IFeatureManager, not IModelDocExtension
Symptom: <unknown>.InsertFeatureChamfer error when calling through model.Extension.
Root cause: InsertFeatureChamfer (DISPID 83) is a method of IFeatureManager, not
IModelDocExtension. Routing it through model.Extension causes DISP_E_MEMBERNOTFOUND.
Fix:
import math
fm = model.FeatureManager # IFeatureManager (property access, no parens)
feature = fm.InsertFeatureChamfer(
1, # Options
1, # ChamferType = swChamferEqualDistance
distance_m, # Width in metres
math.pi / 4, # Angle (45 degrees)
0.0, # OtherDist (unused for equal-distance)
0.0, 0.0, 0.0, # VertexChamDist1, 2, 3 (unused)
)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 584 lines · 0 tokens per session scan A e39c150c9582
com-api-pitfalls is an agent published in the GitHub repository andrewbartels1/SolidworksMCP-python (65 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,513 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
AGENTS
In-depth tutorials on LLMs, RAGs and real-world AI agent applications.
deployment-specialist
Handles all deployment operations.
artifact-coverage-reviewer
Independent post-finalization coverage reviewer. Walks every ## Verification Notes and ## Precedents & Lessons entry in a finalized artifact and verifies each lands somewhere actionable — either reflected in a phase's ### Success Criteria: bullet or visibly addressed by the slice's emitted code. Emits one…
memory-keeper
Updates .claude/memory.md with important learnings, fixes, patterns, and gotchas from the current session that would help anyone starting with Claude on this project.
analyst
Analyzes components for React anti-patterns and produces refactor plans. Use when starting a new refactor subtask.
Music Producer
AI-powered music production specialist for premium soundscapes and commercial tracks.