When developing a PCB design Agent in a DSH environment, it is often necessary to search for electronic components by part number or description. The current approach is to start a bash process and have the model write a curl script on the fly to call a search engine. This has issues such as the high cost and high error rate of starting a process for every invocation, unstructured results, and inability to guarantee design suitability (components may not have EDA models). This plugin wraps the Xiling queryPage search API into a single function call, returning structured JSON in milliseconds, and by default filters out components that do not have EDA models, ensuring the results can be used directly for PCB design.

Plugin Introduction

dsh-tool-pcb-parts-search is a DSH PCB component search tool plugin. The plugin searches for IC / active / passive electronic components by keyword, for PCB design and EDA part selection. It is maintained by Huaqiu-Electronics and licensed under MIT.

Core Capabilities

  1. Component Search: Search for IC / active / passive electronic components by keyword.
  2. Structured Data: Returns JSON data containing mpn, mfgid, description, and datasheet.
  3. EDA Model Filtering: By default, only returns components with a schematic symbol / PCB footprint.
  4. Safety and Robustness:
    - Dual validation of entry parameters (keyword length, page_size range, require_eda_model type).
    - Dual validation of HTTP status code and business code.
    - Sends requests only to the whitelisted domain eda.cn.
    - Defensive structure unpacking and field whitelist filtering.

Installation and Enablement

Use the official installation commands to add the plugin to a DSH Profile:

dsh plugin --profile web add <repo-or-tarball>
dsh plugin --profile headless add <repo-or-tarball>

After installation, the plugin automatically registers the pcb_parts_search tool.

Usage

The tool supports the following parameters:
* keyword: Required, search keyword (part number or description), length limited to 200 characters.
* page_size: Optional, number of returned items, range 1-50, default 5.
* require_eda_model: Optional, whether to return only components with EDA models, default true.

Call examples:

pcb_parts_search { keyword: "STM32F103C8T6" }
pcb_parts_search { keyword: "0402 10k resistor", page_size: 10 }
pcb_parts_search { keyword: "LM358", require_eda_model: false }

Limitations and Notes

  1. Search Method: Supports only keyword fuzzy search, not exact MPN lookup. When exact matching is required, secondary filtering is needed in the returned results.
  2. Data Source: Queries Xiling eda.cn only; does not aggregate other component platforms.
  3. Network Dependency: Requires network access to third-party APIs and is not available in offline environments.
  4. Returned Fields: Does not include procurement information such as inventory, price, or footprint dimensions.

Summary

By wrapping the Xiling API, this plugin provides DSH Agents with standardized PCB component search capabilities, solving the problems of difficult acquisition of structured data and lack of EDA models during EDA part selection. For source code and more information, visit GitHub.