Skip to main content
Glama

openvsp.run_vspaero

Execute aerodynamic analysis on aircraft geometry using VSPAero after applying OpenVSP modifications. Provide geometry commands and case name to run computational fluid dynamics simulations.

Instructions

Run OpenVSP edits followed by VSPAero. Provide geometry commands and case_name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
result_pathNoPath to the generated VSPAero .adb file (if run_vspaero=True)
script_pathYesAbsolute path to the temporary script file

Implementation Reference

  • Handler function for the 'openvsp.run_vspaero' tool, decorated with @app.tool for MCP registration. Delegates to core execute_openvsp with VSPAero enabled.
    @app.tool(
        name="openvsp.run_vspaero",
        description=(
            "Run OpenVSP edits followed by VSPAero. Provide geometry commands and case_name."),
        meta={"version": "0.1.0", "categories": ["geometry", "aero"]},
    )
    def run_vspaero(request: OpenVSPRequest) -> OpenVSPResponse:
        return execute_openvsp(request.model_copy(update={"run_vspaero": True}))
  • Pydantic schema for tool input: OpenVSPRequest, including run_vspaero flag specific to this tool's purpose.
    class OpenVSPRequest(BaseModel):
        """Parameters controlling geometry edits and optional VSPAero run."""
    
        geometry_file: str = Field(..., description="Path to the .vsp3 file")
        set_commands: list[VSPCommand] = Field(default_factory=list, description="Commands to run")
        run_vspaero: bool = Field(True, description="Execute VSPAero after editing geometry")
        case_name: str = Field("case", description="Base name for generated results")
  • Core helper implementing OpenVSP script execution and conditional VSPAero run, invoked by the tool handler.
    def execute_openvsp(request: OpenVSPRequest) -> OpenVSPResponse:
        """Run OpenVSP (and optionally VSPAero) using the provided request."""
    
        with tempfile.TemporaryDirectory(prefix="openvsp_mcp_") as tmpdir:
            workdir = Path(tmpdir)
            script_path = _write_script(request, workdir)
    
            try:
                result = subprocess.run(
                    [OPENVSP_BIN, "-script", str(script_path)],
                    check=False,
                    capture_output=True,
                )
            except FileNotFoundError as exc:  # pragma: no cover
                raise RuntimeError("OpenVSP binary not found") from exc
    
            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() or "OpenVSP script execution failed"
                raise RuntimeError(message)
    
            vspaero_output: str | None = None
            if request.run_vspaero:
                try:
                    aero = subprocess.run(
                        [VSPAERO_BIN, request.geometry_file, request.case_name],
                        check=False,
                        capture_output=True,
                    )
                except FileNotFoundError as exc:  # pragma: no cover
                    raise RuntimeError("VSPAero binary not found") from exc
    
                if aero.returncode != 0:
                    message = aero.stderr.decode("utf-8", errors="ignore").strip()
                    if not message:
                        message = aero.stdout.decode("utf-8", errors="ignore").strip() or "VSPAero execution failed"
                    raise RuntimeError(message)
                vspaero_output = str(Path(request.case_name).with_suffix(".adb"))
    
            return OpenVSPResponse(script_path=str(script_path), result_path=vspaero_output)
  • Generates the temporary OpenVSP script (.vspscript) from the request's set_commands and geometry_file.
    def _write_script(request: OpenVSPRequest, working_dir: Path) -> Path:
        script_path = working_dir / "automation.vspscript"
        commands: Iterable[VSPCommand] = request.set_commands or []
    
        script_lines = [
            "// Auto-generated by openvsp-mcp",
            "void main() {",
            "    ClearVSPModel();",
            f"    ReadVSPFile(\"{request.geometry_file}\");",
        ]
    
        for command in commands:
            script_lines.append(f"    {_ensure_statement(command.command)}")
    
        script_lines.extend(
            [
                "    Update();",
                f"    SetVSP3FileName(\"{request.geometry_file}\");",
                f"    WriteVSPFile(\"{request.geometry_file}\", SET_ALL);",
                "}",
            ]
        )
    
        script_path.write_text("\n".join(script_lines) + "\n", encoding="utf-8")
        return script_path
  • Entry point registers tools by calling build_tool on the FastMCP app instance, which defines openvsp.run_vspaero.
    app = FastMCP(SERVICE_NAME, SERVICE_DESCRIPTION)
    build_tool(app)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool runs edits and VSPAero, implying a mutation operation, but doesn't detail critical behaviors such as whether it modifies the input file in-place, creates new files, requires specific permissions, handles errors, or has performance implications like runtime or resource usage. The description is too sparse for a tool that likely involves complex computational tasks.

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 extremely concise—just one sentence—with no wasted words. It front-loads the core action ('Run OpenVSP edits followed by VSPAero') and includes essential input hints. This efficiency is appropriate, though it may sacrifice detail for brevity.

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 running geometry edits and aerodynamic analysis, the description is incomplete. No annotations exist to clarify safety or behavior, and while an output schema is present (which might describe results), the description doesn't hint at what the tool returns or its operational context. For a tool with nested parameters and likely significant computational impact, more guidance on usage, outcomes, and constraints is needed.

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?

The description mentions 'geometry commands and case_name,' which loosely maps to the 'set_commands' and 'case_name' parameters in the schema. However, with 0% schema description coverage, the schema provides no descriptions for parameters, and the description doesn't fully compensate by explaining all parameters (e.g., 'geometry_file' and 'run_vspaero' are not addressed). It adds minimal semantic value beyond the parameter names, meeting the baseline for partial coverage.

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: 'Run OpenVSP edits followed by VSPAero.' It specifies the verb 'run' and the resources 'OpenVSP edits' and 'VSPAero,' which is specific and actionable. However, it doesn't explicitly distinguish this tool from its siblings (openvsp.inspect and openvsp.modify), which likely involve inspection or modification without the VSPAero execution step.

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 providing 'geometry commands and case_name,' but doesn't explain scenarios where this tool is preferred over openvsp.inspect or openvsp.modify, nor does it outline prerequisites or exclusions. This lack of contextual direction leaves the agent to infer usage based on tool names alone.

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/Three-Little-Birds/openvsp-mcp'

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