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/logging-and-agent-invocationgit 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.03919 |
| Opus 5 | $0.00000 | $0.01959 |
| Sonnet 5 | $0.00000 | $0.00784 |
| Haiku 4.5 | $0.00000 | $0.00392 |
Grade A, and why
logging-and-agent-invocation 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 2d ago.
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 — 535 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Logging Configuration and Agent Invocation Guide
This guide explains how to enable, configure, and use the logging infrastructure for SolidWorks MCP tool execution and multi-turn conversational design workflows.
Overview
The logging system has two layers:
| Layer | Purpose | Capture Source | Scope |
|---|---|---|---|
| MCP Tool Telemetry | Log every SolidWorks tool call, phase transition, and error | MCP server wrapper | Tool lifecycle: pre → execution → post / error |
| Conversation Events | Log chat messages, system events, and decision points | Host/editor or external caller | Full message flow between human and LLM |
For reproducible CAD work, you need both layers. The tool telemetry ensures you can replay and debug every SolidWorks action. The conversation events let you reconstruct why a particular tool was chosen and what context the human provided.
Quick Start: Enable Logging in 60 Seconds
Step 1 — Set Environment Variables
$env:SOLIDWORKS_MCP_ENABLE_DB_LOGGING = "true"
$env:SOLIDWORKS_MCP_CONVERSATION_ID = "my-design-session-001"
$env:SOLIDWORKS_MCP_RUN_ID_PREFIX = "bracket-rebuild"
Step 2 — Start the Server
.\dev-commands.ps1 dev-run
The server uses the variables above for every tool call.
Step 3 — Use the Agent
Work with Claude Code or VS Code Copilot as normal. Every tool call is logged.
Step 4 — Query What Happened
from src.solidworks_mcp.agents import find_run_timeline, find_conversation_events
# See all events in one run
timeline = find_run_timeline("bracket-rebuild-001")
print(timeline)
# See all conversation events linked to that session
events = find_conversation_events("my-design-session-001")
for event in events:
print(f"[{event['created_at']}] {event['role']}: {event['content_snippet']}")
Environment Variables Reference
Logging Control
| Variable | Values | Effect | Default |
|---|---|---|---|
SOLIDWORKS_MCP_ENABLE_DB_LOGGING |
"true" / "false" |
Enable/disable all DB logging | "false" |
SOLIDWORKS_MCP_CONVERSATION_ID |
any string | Conversation context ID (e.g., "baseball-bat-rebuild") | auto-generated |
SOLIDWORKS_MCP_RUN_ID_PREFIX |
any string | Prefix for per-tool-batch run IDs (e.g., "sketch-pass-1") | "run" |
SOLIDWORKS_MCP_DB_PATH |
file path | Override default DB location | .solidworks_mcp/agent_memory.sqlite3 |
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.
- 2d ago First seen · 535 lines · 0 tokens per session scan A 90e2c7eb445d
logging-and-agent-invocation is an agent published in the GitHub repository andrewbartels1/SolidworksMCP-python (65 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,919 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.
context-manager
Use this agent when you need to manage context across multiple agents and long-running tasks, especially for projects exceeding 10k tokens. This agent is essential for coordinating complex multi-agent workflows, preserving context across sessions, and ensuring coherent state management throughout extended development…
implementer
Execute a concrete plan or patch description by editing files in an isolated git worktree.
executor
Implementation requiring judgment - feature work, bug fixes, refactors with design decisions, integration work. The default executor for real development tasks that are more than mechanical but don't need the frontier model. Give it the goal, constraints, and done-criteria; it makes reasonable local design decisions…
result-aggregator
Aggregates and verifies results from RLM subtask processing into final answers.
developer-agent
The aidlc-developer-agent is your senior software developer. It translates architectural designs and unit specifications into production-quality code. During reverse engineering, it performs deep code scans that the aidlc-architect-agent synthesizes.