How the step.parts Skill Finds Off-the-Shelf Components for CAD Assemblies
The step.parts skill queries the public step.parts catalog to locate standard mechanical hardware and download geometry-ready STEP files, eliminating the need to model common components like bolts and bearings from scratch.
The earthtojake/text-to-cad repository implements this skill as a modular bridge between large language model (LLM) agents and curated mechanical part libraries. By invoking the step.parts skill, the Text-to-CAD system converts natural language requests such as "add an M8 hex bolt" into validated, manufacturable geometry that integrates directly into CAD workflows.
What Is the step.parts Skill?
The step.parts skill is a specialized download module designed to retrieve standard mechanical components from the public step.parts database. It functions as a skill within the broader Text-to-CAD architecture, exposing standardized interfaces that higher-level assembly generators can call when they need real-world hardware specifications.
The architecture consists of four discrete layers working in concert:
- Skill Definition (
skills/step-parts/SKILL.md): Declares the skill's purpose, input schema (part name and optional filters), and output format (local STEP file path). - Agent Configuration (
skills/step-parts/agents/openai.yaml): Provides LLM prompt templates that teach the model how to formulate valid skill invocations. - Runtime Script (
skills/step-parts/scripts/download_step_part.py): Executes HTTP requests to the step.parts API with a customUser-Agentheader (step-parts-skill/1.0). - Reference Documentation (
skills/step-parts/references/step-parts-api.md): Documents the external API contract including endpoints, query parameters, and response fields.
How the step.parts Skill Locates Components
When a CAD assembly skill requires standard hardware, the step.parts skill executes a four-stage retrieval pipeline:
- Search: The
download_step_part.pyscript constructs a query string from natural language input and sends a GET request tohttps://api.step.parts. - Filter: The system applies optional parameters such as material specifications or tolerance classes to narrow result sets.
- Select: The skill selects the most appropriate catalog entry, typically defaulting to the first match when multiple results exist.
- Download: The script retrieves the STEP file geometry and caches it locally, returning the file path to the calling agent.
Because the step.parts catalog contains pre-validated, manufacturing-ready geometry, this pipeline eliminates manual modeling time and ensures components match real-world specifications.
Implementation Details
Skill Definition and Agent Configuration
The SKILL.md file in skills/step-parts/ serves as the contract between the LLM and the execution environment. It defines the expected inputs—such as query strings describing "M8 hex nut, steel"—and guarantees an output containing a valid filesystem path to the downloaded geometry.
The openai.yaml configuration file translates these contracts into LLM-friendly prompt templates. This ensures that when an agent processes a request like "find a 6204-2RS bearing," it generates the correct JSON structure to invoke download_step_part.py with appropriate arguments.
Core Download Logic
The Python implementation in skills/step-parts/scripts/download_step_part.py handles the actual network operations. The script builds HTTPS requests targeting the public API origin, includes the identifying User-Agent: step-parts-skill/1.0 header, and parses JSON responses to extract download URLs.
Function signature and behavior follow this pattern:
from skills.step-parts.scripts.download_step_part import download_part
# Returns local file path to STEP geometry
step_file = download_part(
query="6204-2RS deep-groove ball bearing",
origin="https://api.step.parts",
timeout=15
)
The function manages temporary file storage and error handling, ensuring downstream CAD processors receive valid geometry files even when network conditions vary.
API Reference Documentation
Developers extending the skill can consult skills/step-parts/references/step-parts-api.md, which documents the query parameter schema and response field definitions. This reference enables customization of the default origin or implementation of additional filtering logic for specialized hardware categories.
Usage Examples
You can invoke the step.parts skill directly from the command line for ad-hoc component retrieval:
python -m skills.step-parts.scripts.download_step_part \
--query "M8 hex nut, steel, 0.5 mm tolerance" \
--output ./parts/m8_hex_nut.stp
For programmatic integration within larger CAD pipelines, import the download function directly:
from skills.step-parts.scripts.download_step_part import download_part
# Search and retrieve standard hardware
step_file = download_part(
query="M8 hex bolt",
origin="https://api.step.parts",
timeout=15
)
print(f"Downloaded STEP geometry saved at: {step_file}")
Both methods return filesystem paths to geometry-ready STEP files suitable for immediate import into CAD kernels or URDF generators.
Summary
- The step.parts skill bridges Text-to-CAD agents with the public step.parts catalog of standard mechanical components.
- Four-stage retrieval (search, filter, select, download) automates the acquisition of bolts, bearings, shafts, and other hardware.
- Source files in
skills/step-parts/include the skill definition (SKILL.md), LLM prompts (agents/openai.yaml), and the core HTTP client (scripts/download_step_part.py). - API integration uses
https://api.step.partswith the identifyingUser-Agent: step-parts-skill/1.0header. - Flexible usage supports both CLI execution and Python module imports for embedding in automated CAD assembly workflows.
Frequently Asked Questions
What types of components can the step.parts skill find?
The skill queries a curated catalog of standard mechanical hardware including fasteners (bolts, nuts, screws), bearings (ball, roller, thrust), shafts, gears, and structural extrusions. Because the database focuses on commercially available, standardized parts, it excels at locating items with industry-standard specifications like ISO or DIN designations.
How does the step.parts skill integrate with LLM agents?
According to the skills/step-parts/agents/openai.yaml configuration, the skill exposes structured prompt templates that teach LLMs to recognize hardware requests and generate valid skill invocations. When the agent parses a natural language request such as "add a steel M8 nut," it automatically calls the download_part function with the appropriate query parameters, treating the STEP file retrieval as a deterministic tool use operation.
Can I use the step.parts skill outside the Text-to-CAD system?
Yes. While designed for the earthtojake/text-to-cad ecosystem, the download_step_part.py script functions as a standalone Python module. You can import download_part into any Python environment with network access, or execute the script via CLI to retrieve STEP files for use in other CAD, simulation, or manufacturing workflows.
What is the default API endpoint for the step.parts skill?
The default origin is https://api.step.parts, as implemented in skills/step-parts/scripts/download_step_part.py. The script sends GET requests to this endpoint with the custom header User-Agent: step-parts-skill/1.0 to identify skill-specific traffic, though developers can override the origin parameter when calling download_part to point at private mirrors or staging environments.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →