get_project_structure
Retrieve the file structure and organization of a KiCad electronic design project to understand its components and layout.
Instructions
Get the structure and files of a KiCad project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes |
Implementation Reference
- kicad_mcp/tools/project_tools.py:30-54 (handler)The handler function decorated with @mcp.tool() that implements the get_project_structure tool logic, retrieving project files and metadata.@mcp.tool() def get_project_structure(project_path: str) -> Dict[str, Any]: """Get the structure and files of a KiCad project.""" if not os.path.exists(project_path): return {"error": f"Project not found: {project_path}"} project_dir = os.path.dirname(project_path) project_name = os.path.basename(project_path)[:-10] # Remove .kicad_pro extension # Get related files files = get_project_files(project_path) # Get project metadata metadata = {} project_data = load_project_json(project_path) if project_data and "metadata" in project_data: metadata = project_data["metadata"] return { "name": project_name, "path": project_path, "directory": project_dir, "files": files, "metadata": metadata }
- kicad_mcp/server.py:149-149 (registration)The call to register_project_tools which registers the get_project_structure tool (among others) to the MCP server.register_project_tools(mcp)