Skip to main content
Glama
NellyW8

EDA Tools MCP Server

by NellyW8

view_gds

Open GDSII layout files in KLayout viewer to visualize integrated circuit designs from Electronic Design Automation workflows.

Instructions

Open GDSII file in KLayout viewer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID from OpenLane run
gds_fileNoSpecific GDS filename (optional, auto-detected if not provided)

Implementation Reference

  • The main handler function for the 'view_gds' tool. It retrieves the project, locates the GDS file (auto-detects if not specified), verifies its existence, and launches KLayout viewer using the macOS 'open' command.
    async viewGds(projectId: string, gdsFile?: string): Promise<string> {
      try {
        const project = this.projects.get(projectId);
        if (!project) {
          return JSON.stringify({
            success: false,
            error: `Project ${projectId} not found.`,
          }, null, 2);
        }
    
        let gdsPath = "";
        
        if (gdsFile) {
          // Specific GDS file provided
          gdsPath = join(project.dir, gdsFile);
        } else {
          // Auto-find GDS file in OpenLane project
          const runsDir = join(project.dir, "runs");
          try {
            const runs = await fs.readdir(runsDir);
            if (runs.length > 0) {
              const latestRun = runs.sort().reverse()[0];
              const finalDir = join(runsDir, latestRun, "final", "gds");
              const gdsFiles = await fs.readdir(finalDir);
              const gdsFilesList = gdsFiles.filter(f => f.endsWith('.gds'));
              if (gdsFilesList.length > 0) {
                gdsPath = join(finalDir, gdsFilesList[0]);
              }
            }
          } catch {
            return JSON.stringify({
              success: false,
              error: "No GDS files found in project. Run OpenLane flow first.",
            }, null, 2);
          }
        }
    
        if (!gdsPath) {
          return JSON.stringify({
            success: false,
            error: "No GDS file found to open.",
          }, null, 2);
        }
    
        // Check if GDS file exists
        try {
          await fs.access(gdsPath);
        } catch {
          return JSON.stringify({
            success: false,
            error: `GDS file not found: ${gdsPath}`,
          }, null, 2);
        }
    
        // Launch KLayout directly with the correct command format
        const klayoutCmd = `open -a KLayout "${gdsPath}"`;
        await execAsyncWithTimeout(klayoutCmd, { shell: true }, 10000);
    
        return JSON.stringify({
          success: true,
          message: `KLayout launched with GDS file`,
          gds_file: basename(gdsPath),
          gds_path: gdsPath,
          project_id: projectId,
          command_executed: klayoutCmd
        }, null, 2);
    
      } catch (error: any) {
        return JSON.stringify({
          success: false,
          error: error.message || String(error),
        }, null, 2);
      }
    }
  • src/index.ts:819-836 (registration)
    Registration of the 'view_gds' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
    {
      name: "view_gds",
      description: "Open GDSII file in KLayout viewer",
      inputSchema: {
        type: "object",
        properties: {
          project_id: { 
            type: "string", 
            description: "Project ID from OpenLane run" 
          },
          gds_file: { 
            type: "string", 
            description: "Specific GDS filename (optional, auto-detected if not provided)" 
          },
        },
        required: ["project_id"],
      },
    },
  • src/index.ts:916-926 (registration)
    The switch case in the CallToolRequestSchema handler that dispatches 'view_gds' tool calls to the EDAServer.viewGds method.
    case "view_gds": {
      const projectId = validateRequiredString(args, "project_id", name);
      const gdsFile = getStringProperty(args, "gds_file", "");
      
      return {
        content: [{
          type: "text",
          text: await edaServer.viewGds(projectId, gdsFile || undefined),
        }],
      };
    }
  • Input schema definition for the 'view_gds' tool, specifying parameters project_id (required) and gds_file (optional).
    inputSchema: {
      type: "object",
      properties: {
        project_id: { 
          type: "string", 
          description: "Project ID from OpenLane run" 
        },
        gds_file: { 
          type: "string", 
          description: "Specific GDS filename (optional, auto-detected if not provided)" 
        },
      },
      required: ["project_id"],
    },
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 the action ('Open') but doesn't describe what happens (e.g., launches a viewer, requires GUI access, may be interactive, or returns status). It lacks details on permissions, side effects, or error handling for a tool that likely involves external applications.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of opening a file in an external viewer (which may involve GUI dependencies, error states, or interactive behavior), the description is insufficient. With no annotations and no output schema, it doesn't address what the tool returns, how failures are handled, or any system requirements, leaving significant gaps for an agent to use it correctly.

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 100%, so the schema already documents both parameters fully. The description doesn't add any meaning beyond what the schema provides (e.g., it doesn't explain the relationship between project_id and gds_file, or typical use cases for providing gds_file). Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Open') and the resource ('GDSII file in KLayout viewer'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'view_waveform' which might also involve viewing operations in different contexts.

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 doesn't mention prerequisites (e.g., needing an existing OpenLane project), exclusions, or comparisons to sibling tools like 'read_openlane_reports' or 'view_waveform'.

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/NellyW8/mcp-EDA'

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