Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

oil_viscosity

Calculate oil viscosity at reservoir conditions using the Beggs-Robinson correlation to analyze flow rates, pressure drops, and recovery efficiency in petroleum engineering.

Instructions

Calculate oil viscosity (μo).

CRITICAL PVT PROPERTY - Computes oil viscosity at reservoir conditions. Viscosity affects flow rates, pressure drops, and recovery efficiency. Uses Beggs-Robinson (1975) correlation, industry standard for oil viscosity.

Parameters:

  • api (float, required): Oil API gravity in degrees. Valid: 0-100. Example: 35.0. Higher API = lighter oil = lower viscosity.

  • degf (float, required): Reservoir temperature in °F. Valid: -460 to 1000. Example: 180.0. Higher temperature = lower viscosity.

  • p (float or list, required): Pressure(s) in psia. Must be > 0. Can be scalar or array. Example: 3000.0 or [2000, 3000, 4000].

  • pb (float, optional, default=0.0): Bubble point pressure in psia. Required for accurate calculation. Example: 3500.0.

  • rs (float or list, optional, default=0.0): Solution GOR at pressure p in scf/stb. If 0, will be calculated. Must match p shape. Example: 600.0.

  • rsb (float, optional, default=0.0): Solution GOR at bubble point in scf/stb. Required if pb provided. Example: 800.0.

  • method (str, optional, default="BR"): Correlation method. Only "BR" available.

Viscosity Behavior:

  • p < pb: Viscosity decreases with pressure (more gas dissolves, oil thins)

  • p = pb: Viscosity reaches minimum (μob, typically 0.5-5 cP)

  • p > pb: Viscosity increases with pressure (oil compression)

Typical Ranges:

  • Light oils (API > 35): 0.5-2 cP at bubble point

  • Medium oils (API 25-35): 1-10 cP at bubble point

  • Heavy oils (API < 25): 10-1000+ cP at bubble point

Returns: Dictionary with:

  • value (float or list): Viscosity in cP (matches input p shape)

  • method (str): "BR" (Beggs-Robinson)

  • units (str): "cP"

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Not providing rs when p < pb (will calculate incorrectly)

  • Using dead oil viscosity instead of live oil viscosity

  • Temperature in Celsius instead of Fahrenheit

  • Pressure in barg/psig instead of psia

Example Usage:

{
    "api": 35.0,
    "degf": 180.0,
    "p": [2000, 3000, 4000],
    "pb": 3500.0,
    "rs": [400, 600, 800],
    "rsb": 800.0,
    "method": "BR"
}

Result: Viscosity decreases from ~1.2 cP at 2000 psia to ~0.8 cP at 3500 psia, then increases to ~0.85 cP at 4000 psia (above bubble point).

Note: Viscosity is highly sensitive to temperature and dissolved gas content. Always use reservoir temperature, not separator temperature.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full burden and excels. It explains the correlation method used, viscosity behavior patterns (p < pb, p = pb, p > pb), typical value ranges for different oil types, sensitivity to temperature/gas content, and includes important warnings about common mistakes. This provides comprehensive behavioral context beyond basic parameter documentation.

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 clear sections (Parameters, Viscosity Behavior, Typical Ranges, Returns, Common Mistakes, Example Usage, Note). While comprehensive, some sections could be more concise - the 'Common Mistakes' and 'Example Usage' are quite detailed. However, every sentence adds value for understanding this complex calculation.

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?

For a complex 7-parameter engineering tool with no annotations and 0% schema description coverage, the description provides exceptional completeness. It covers purpose, methodology, parameter semantics, behavioral patterns, typical outputs, common pitfalls, and includes a detailed example. The existence of an output schema reduces the need to explain return format, but the description still helpfully summarizes it.

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?

With 0% schema description coverage, the description fully compensates by providing detailed parameter explanations including physical meaning, valid ranges, examples, and relationships between parameters. It explains how api affects viscosity, temperature effects, pressure behavior, and the critical relationship between p, pb, rs, and rsb that isn't apparent from schema alone.

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 calculates oil viscosity at reservoir conditions using the Beggs-Robinson correlation. It specifies this is a 'CRITICAL PVT PROPERTY' and distinguishes from siblings like oil_density or oil_compressibility by focusing specifically on viscosity behavior and calculation methodology.

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 about when this tool is relevant (for reservoir engineering calculations affecting flow rates and recovery) and includes 'Common Mistakes' section that implicitly guides usage. However, it doesn't explicitly state when to use alternatives like gas_viscosity or other oil property tools.

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