Reads KiCad's IPC API proto definitions and uses the Claude API to generate
rich, user-facing descriptions for MCP tool metadata. The output JSON file
can be loaded by an MCP server at startup to annotate auto-generated tools.
Features:
- Fetches proto files from KiCad GitLab or loads from a local checkout
- Pure-Python proto parser (no protoc dependency)
- Prompt caching on the static proto context block — re-runs are cheap
- --resume to skip already-annotated messages after an interrupted run
- --dry-run to preview what would be annotated without calling the API
- Reports cache hit/write/read token counts after each API call
Usage:
python scripts/generate_tool_annotations.py --fetch-from-gitlab
python scripts/generate_tool_annotations.py --proto-dir /path/to/kicad/api/proto
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>