Skip to main content
Glama
IBM

Physics MCP Server

by IBM

calculate_venturi_effect

Compute throat velocity, pressure drop, and volumetric flow rate for fluid flowing through a constriction, applying the continuity equation and Bernoulli's principle.

Instructions

Calculate Venturi effect (flow through constriction).

Uses continuity equation and Bernoulli's principle.

Args:
    inlet_diameter: Inlet diameter in meters
    throat_diameter: Throat (constriction) diameter in meters
    inlet_velocity: Inlet velocity in m/s
    fluid_density: Fluid density in kg/m³

Returns:
    Dict containing:
        - throat_velocity: Velocity at throat in m/s
        - pressure_drop: Pressure drop from inlet to throat in Pascals
        - flow_rate: Volumetric flow rate in m³/s

Example - Venturi meter:
    result = await calculate_venturi_effect(
        inlet_diameter=0.1,  # 10 cm
        throat_diameter=0.05,  # 5 cm
        inlet_velocity=2.0,  # m/s
        fluid_density=1000  # water
    )
    # throat_velocity = 8 m/s (4x area reduction)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inlet_diameterYes
throat_diameterYes
inlet_velocityYes
fluid_densityYes

Implementation Reference

  • Async tool handler for calculate_venturi_effect that wraps the core logic. Decorated with @tool for MCP registration. Accepts inlet_diameter, throat_diameter, inlet_velocity, fluid_density and returns throat_velocity, pressure_drop, flow_rate.
    async def calculate_venturi_effect(
        inlet_diameter: float,
        throat_diameter: float,
        inlet_velocity: float,
        fluid_density: float,
    ) -> dict:
        """Calculate Venturi effect (flow through constriction).
    
        Uses continuity equation and Bernoulli's principle.
    
        Args:
            inlet_diameter: Inlet diameter in meters
            throat_diameter: Throat (constriction) diameter in meters
            inlet_velocity: Inlet velocity in m/s
            fluid_density: Fluid density in kg/m³
    
        Returns:
            Dict containing:
                - throat_velocity: Velocity at throat in m/s
                - pressure_drop: Pressure drop from inlet to throat in Pascals
                - flow_rate: Volumetric flow rate in m³/s
    
        Example - Venturi meter:
            result = await calculate_venturi_effect(
                inlet_diameter=0.1,  # 10 cm
                throat_diameter=0.05,  # 5 cm
                inlet_velocity=2.0,  # m/s
                fluid_density=1000  # water
            )
            # throat_velocity = 8 m/s (4x area reduction)
        """
        from ..fluid_advanced import VenturiEffectRequest, calculate_venturi_effect as calc_venturi
    
        request = VenturiEffectRequest(
            inlet_diameter=inlet_diameter,
            throat_diameter=throat_diameter,
            inlet_velocity=inlet_velocity,
            fluid_density=fluid_density,
        )
        response = calc_venturi(request)
        return response.model_dump()
  • The @tool decorator on line 497 registers calculate_venturi_effect as an MCP tool in the tools/fluid.py module.
    @tool  # type: ignore[arg-type]
    async def calculate_venturi_effect(
        inlet_diameter: float,
        throat_diameter: float,
        inlet_velocity: float,
        fluid_density: float,
    ) -> dict:
        """Calculate Venturi effect (flow through constriction).
    
        Uses continuity equation and Bernoulli's principle.
    
        Args:
            inlet_diameter: Inlet diameter in meters
            throat_diameter: Throat (constriction) diameter in meters
            inlet_velocity: Inlet velocity in m/s
            fluid_density: Fluid density in kg/m³
    
        Returns:
            Dict containing:
                - throat_velocity: Velocity at throat in m/s
                - pressure_drop: Pressure drop from inlet to throat in Pascals
                - flow_rate: Volumetric flow rate in m³/s
    
        Example - Venturi meter:
            result = await calculate_venturi_effect(
                inlet_diameter=0.1,  # 10 cm
                throat_diameter=0.05,  # 5 cm
                inlet_velocity=2.0,  # m/s
                fluid_density=1000  # water
            )
            # throat_velocity = 8 m/s (4x area reduction)
        """
        from ..fluid_advanced import VenturiEffectRequest, calculate_venturi_effect as calc_venturi
    
        request = VenturiEffectRequest(
            inlet_diameter=inlet_diameter,
            throat_diameter=throat_diameter,
            inlet_velocity=inlet_velocity,
            fluid_density=fluid_density,
        )
        response = calc_venturi(request)
        return response.model_dump()
Behavior4/5

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

No annotations are provided, but the description adequately describes the mathematical computation and expected inputs/outputs. For a pure calculation tool, this covers behavioral traits sufficiently. It does not disclose any side effects because none exist.

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 well-structured with sections for purpose, parameter list, return values, and an example. Every sentence adds value; no fluff.

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

Completeness5/5

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

Given no output schema, the description fully specifies the return dictionary with keys, units, and an example. All necessary information for a physics calculation tool is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description includes detailed docstrings for each parameter with units (e.g., 'inlet diameter in meters'). This adds significant meaning beyond the bare schema, enabling correct usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it calculates the Venturi effect using continuity equation and Bernoulli's principle. The specific verb 'calculate' and resource 'Venturi effect' are precise, and the tool is distinct from sibling physics calculation tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'flow through constriction' and provides an example, but does not explicitly guide when to use this tool over closely related siblings like 'calculate_bernoulli'. No 'when not to use' or alternatives are given.

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/IBM/chuk-mcp-physics'

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