Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

oil_sg_from_jacoby

Calculate oil specific gravity using molecular weight and aromaticity factor for petroleum fraction characterization in reservoir engineering.

Instructions

Calculate oil specific gravity from molecular weight and Jacoby aromaticity.

HYDROCARBON CHARACTERIZATION TOOL - Estimates specific gravity for undefined petroleum fractions using molecular weight and aromaticity.

Jacoby Aromaticity Factor (JA):

  • 0.0 = Pure paraffinic (alkanes)

  • 0.5 = Mixed (typical crude oils)

  • 1.0 = Pure aromatic

Applications:

  • Plus fraction (C7+) characterization

  • Undefined heavy end lumping

  • EOS fluid modeling

  • Pseudo-component generation

Returns specific gravity (dimensionless, water=1).

Args: request: Molecular weight and Jacoby aromaticity factor

Returns: Dictionary with specific gravity, method, and inputs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler function decorated with @mcp.tool(). It takes JacobyAromaticitySGRequest, calls pyrestoolbox.oil.oil_ja_sg(mw, ja), handles array/scalar output, and returns formatted dict with value, method, units, inputs.
    @mcp.tool()
    def oil_sg_from_jacoby(request: JacobyAromaticitySGRequest) -> dict:
        """Calculate oil specific gravity from molecular weight and Jacoby aromaticity.
    
        **HYDROCARBON CHARACTERIZATION TOOL** - Estimates specific gravity
        for undefined petroleum fractions using molecular weight and aromaticity.
    
        **Jacoby Aromaticity Factor (JA):**
        - 0.0 = Pure paraffinic (alkanes)
        - 0.5 = Mixed (typical crude oils)
        - 1.0 = Pure aromatic
    
        **Applications:**
        - Plus fraction (C7+) characterization
        - Undefined heavy end lumping
        - EOS fluid modeling
        - Pseudo-component generation
    
        Returns specific gravity (dimensionless, water=1).
    
        Args:
            request: Molecular weight and Jacoby aromaticity factor
    
        Returns:
            Dictionary with specific gravity, method, and inputs
        """
        sg = oil.oil_ja_sg(mw=request.mw, ja=request.ja)
    
        if isinstance(sg, np.ndarray):
            value = sg.tolist()
        else:
            value = float(sg)
    
        return {
            "value": value,
            "method": "Jacoby aromaticity correlation",
            "units": "dimensionless (water=1)",
            "inputs": request.model_dump(),
        }
  • Pydantic model defining the input schema for the tool, with fields for molecular weight (mw > 0) and Jacoby aromaticity factor (ja in [0,1]), supporting scalar or list inputs.
    class JacobyAromaticitySGRequest(BaseModel):
        """Request model for Jacoby aromaticity to SG calculation."""
    
        mw: Union[float, List[float]] = Field(
            ..., gt=0, description="Molecular weight (lb/lbmol) - scalar or array"
        )
        ja: Union[float, List[float]] = Field(
            ..., ge=0, le=1, description="Jacoby aromaticity factor (0=paraffinic, 1=aromatic)"
        )
  • Import of register_oil_tools from oil_tools.py and call to register_oil_tools(mcp), which defines and registers all oil tools including oil_sg_from_jacoby with the FastMCP server instance.
    from .tools.oil_tools import register_oil_tools
    from .tools.gas_tools import register_gas_tools
    from .tools.inflow_tools import register_inflow_tools
    from .tools.simtools_tools import register_simtools_tools
    from .tools.brine_tools import register_brine_tools
    from .tools.layer_tools import register_layer_tools
    from .tools.library_tools import register_library_tools
    
    register_oil_tools(mcp)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it 'Estimates specific gravity' (clarifying it's an estimation), explains the Jacoby aromaticity factor scale, and states the return format ('Returns specific gravity (dimensionless, water=1)' and 'Dictionary with specific gravity, method, and inputs'). It lacks details on error handling or computational limits, but covers core behavioral aspects well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bold headings and bullet points, making it easy to scan. It is appropriately sized, with every sentence adding value (e.g., explaining the tool's purpose, factor scale, applications, and returns). A minor point: the 'Args' and 'Returns' sections slightly repeat information from earlier, but overall it's efficient and front-loaded.

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 the tool's complexity (involving specialized petroleum engineering calculations), no annotations, and an output schema present, the description is complete enough. It covers purpose, parameter semantics, usage context, and behavioral details like the estimation nature and return format. The output schema handles return values, so the description doesn't need to explain them further.

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%, so the description must compensate fully. It adds significant meaning beyond the schema: it explains that 'mw' is 'Molecular weight (lb/lbmol)' and 'ja' is the 'Jacoby aromaticity factor' with a detailed scale (0.0 to 1.0), including interpretations like '0.0 = Pure paraffinic' and '1.0 = Pure aromatic.' This provides essential context not in the schema.

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 the tool's purpose: 'Calculate oil specific gravity from molecular weight and Jacoby aromaticity.' It specifies the verb ('Calculate'), resource ('oil specific gravity'), and method ('from molecular weight and Jacoby aromaticity'), distinguishing it from sibling tools like 'oil_sg_from_api' or 'gas_sg_from_composition' that use different inputs.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool through the 'Applications' section, listing specific scenarios like 'Plus fraction (C7+) characterization' and 'EOS fluid modeling.' However, it does not explicitly state when not to use it or name alternative tools (e.g., 'oil_sg_from_api'), though the context implies it's for undefined petroleum fractions.

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/gabrielserrao/pyrestoolbox-mcp'

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