Skip to main content
Glama
lamaalrajih

KiCad MCP Server

by lamaalrajih

extract_project_netlist

Extract netlist information from KiCad schematic files to analyze circuit connections and component relationships in electronic design projects.

Instructions

Extract netlist from a KiCad project's schematic.

This tool finds the schematic associated with a KiCad project and extracts its netlist information.

Args: project_path: Path to the KiCad project file (.kicad_pro) ctx: MCP context for progress reporting

Returns: Dictionary with netlist information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
ctxYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the extract_project_netlist tool. It finds the schematic in the project, extracts the netlist using extract_schematic_netlist, and returns the results.
    @mcp.tool()
    async def extract_project_netlist(project_path: str, ctx: Context | None) -> Dict[str, Any]:
        """Extract netlist from a KiCad project's schematic.
        
        This tool finds the schematic associated with a KiCad project
        and extracts its netlist information.
        
        Args:
            project_path: Path to the KiCad project file (.kicad_pro)
            ctx: MCP context for progress reporting
            
        Returns:
            Dictionary with netlist information
        """
        print(f"Extracting netlist for project: {project_path}")
        
        if not os.path.exists(project_path):
            print(f"Project not found: {project_path}")
            if ctx:
                ctx.info(f"Project not found: {project_path}")
            return {"success": False, "error": f"Project not found: {project_path}"}
        
        # Report progress
        if ctx:
            await ctx.report_progress(10, 100)
        
        # Get the schematic file
        try:
            files = get_project_files(project_path)
            
            if "schematic" not in files:
                print("Schematic file not found in project")
                if ctx:
                    ctx.info("Schematic file not found in project")
                return {"success": False, "error": "Schematic file not found in project"}
            
            schematic_path = files["schematic"]
            print(f"Found schematic file: {schematic_path}")
            if ctx:
                ctx.info(f"Found schematic file: {os.path.basename(schematic_path)}")
            
            # Extract netlist
            if ctx:
                await ctx.report_progress(20, 100)
            
            # Call the schematic netlist extraction
            result = await extract_schematic_netlist(schematic_path, ctx)
            
            # Add project path to result
            if "success" in result and result["success"]:
                result["project_path"] = project_path
            
            return result
            
        except Exception as e:
            print(f"Error extracting project netlist: {str(e)}")
            if ctx:
                ctx.info(f"Error extracting project netlist: {str(e)}")
            return {"success": False, "error": str(e)}
  • The call to register_netlist_tools(mcp) in the server creation, which registers all netlist tools including extract_project_netlist.
    register_netlist_tools(mcp)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe important behavioral aspects: whether this is a read-only operation, what permissions are needed, whether it modifies files, error handling, performance characteristics, or what specific netlist information is returned. The mention of 'progress reporting' via ctx hints at potentially long-running operations, but this isn't elaborated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is reasonably concise with clear sections: purpose statement, brief explanation, Args section, and Returns section. The front-loaded purpose statement is effective. The Args section could be more integrated with the flow, but overall the structure is logical with minimal wasted text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (returns a dictionary with netlist information), the description doesn't need to detail return values. However, with no annotations, 0% schema description coverage, and a mutation-adjacent operation ('extract' could imply file reading or processing), the description should provide more behavioral context about what 'extract' entails and how it differs from similar tools. The current description is minimally adequate but leaves important questions unanswered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter documentation. The description adds basic semantics for 'project_path' (path to .kicad_pro file) and mentions 'ctx' is for 'progress reporting,' which provides some value beyond the bare schema. However, it doesn't explain parameter constraints, formats, or examples, leaving significant gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Extract netlist from a KiCad project's schematic' and 'extracts its netlist information.' It specifies the verb ('extract'), resource ('netlist'), and source ('KiCad project's schematic'). However, it doesn't explicitly differentiate from sibling tools like 'extract_schematic_netlist' or 'analyze_schematic_connections,' which appears to be a closely related operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions finding the schematic associated with a project, but doesn't clarify when to choose this over 'extract_schematic_netlist' (which might work directly on schematic files) or other analysis tools. No prerequisites, exclusions, or comparison with sibling tools are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lamaalrajih/kicad-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server