feat: load IPC API annotations at startup to enrich tool descriptions

Adds python/annotations/loader.py (AnnotationLoader) which resolves MCP
tool names to KiCad IPC proto message annotations using three layers:
  1. Explicit TOOL_TO_PROTO mapping for non-obvious name pairs
  2. Automatic snake_case → PascalCase conversion
  3. Suffix-stripped variants (get_nets_list → GetNets)

Integrates into kicad_interface.py tools/list handler:
  - Tools with existing schemas: enrich_schema() adds blocking/interactive
    ToolAnnotations hints and fills description gaps
  - Tools without schemas (fallback): gets a real description from the
    IPC annotation instead of the generic "KiCAD command: <name>" string

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Samuel Price
2026-04-19 11:32:12 -04:00
parent 8253550715
commit 91f4a05a00
3 changed files with 198 additions and 12 deletions

View File

@@ -0,0 +1,4 @@
"""KiCad IPC API tool annotations package."""
from .loader import AnnotationLoader
__all__ = ["AnnotationLoader"]