Skip to main content
Glama

openvsp.inspect

Analyze OpenVSP geometry files to extract component IDs and structural information without altering the original design.

Instructions

Describe an OpenVSP geometry without modifying it. Returns component IDs and raw info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Implementation Reference

  • The handler function for the 'openvsp.inspect' tool, registered via FastMCP decorator. Extracts geometry_file from request and calls describe_geometry helper.
    @app.tool( name="openvsp.inspect", description=( "Describe an OpenVSP geometry without modifying it. Returns component IDs and raw info."), meta={"version": "0.1.0", "categories": ["geometry", "aero", "inspection"]}, ) def inspect(request: OpenVSPGeometryRequest) -> OpenVSPInspectResponse: return describe_geometry(request.geometry_file)
  • Core helper function implementing the inspection logic: generates a no-op script, runs OpenVSP, checks exit code, parses .vsp3 XML to extract geometry IDs, wing names, and detailed component info.
    def describe_geometry(geometry_file: str) -> OpenVSPInspectResponse: """Run OpenVSP in describe mode and parse high-level geometry information.""" with tempfile.TemporaryDirectory(prefix="openvsp_mcp_describe_") as tmpdir: temp_request = OpenVSPRequest( geometry_file=geometry_file, set_commands=[], run_vspaero=False, case_name="describe", ) script_path = _write_script(temp_request, Path(tmpdir)) result = subprocess.run( [OPENVSP_BIN, "-script", str(script_path)], check=False, capture_output=True, ) if result.returncode not in _OK_EXIT_CODES: message = result.stderr.decode("utf-8", errors="ignore").strip() if not message: message = result.stdout.decode("utf-8", errors="ignore").strip() raise RuntimeError(message or "OpenVSP describe run failed") tree = ET.parse(geometry_file) root = tree.getroot() geom_ids: list[str] = [] wing_names: list[str] = [] info_lines: list[str] = [] for geom in root.findall(".//Geom"): name_elem = geom.find("ParmContainer/Name") geom_name = name_elem.text if name_elem is not None else "" id_elem = geom.find("ParmContainer/ID") geom_id = id_elem.text if id_elem is not None else "" type_elem = geom.find("GeomBase/TypeName") geom_type = type_elem.text if type_elem is not None else "" if geom_id: geom_ids.append(geom_id) if geom_type.lower() == "wing" and geom_name: wing_names.append(geom_name) info_lines.append(f"{geom_id or 'UNKNOWN'}:{geom_name or 'Unnamed'}:{geom_type or 'Unknown'}") return OpenVSPInspectResponse( geom_ids=geom_ids, wing_names=wing_names, info_log="\n".join(info_lines), )
  • Pydantic input schema for the openvsp.inspect tool request, requiring the path to the .vsp3 geometry file.
    class OpenVSPGeometryRequest(BaseModel): geometry_file: str = Field(..., description="Path to the .vsp3 file")
  • Pydantic output schema for the openvsp.inspect tool response, containing lists of geometry IDs and wing names, plus detailed info log.
    class OpenVSPInspectResponse(BaseModel): """High-level summary of a geometry.""" geom_ids: list[str] = Field(..., description="Top-level geometry IDs discovered") wing_names: list[str] = Field(default_factory=list, description="Detected wing geometry names") info_log: str = Field(..., description="Raw output from OpenVSP describe command")
  • Invocation of build_tool on the FastMCP server instance, which registers the openvsp.inspect tool (along with others).
    build_tool(app)

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/yevheniikravchuk/openvsp-mcp'

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