Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

oil_compressibility

Calculate oil compressibility coefficient to measure volume changes with pressure for material balance calculations, pressure transient analysis, and reserve estimation in petroleum engineering.

Instructions

Calculate oil compressibility (Co).

CRITICAL PVT PROPERTY - Computes oil compressibility coefficient, which measures how much oil volume changes with pressure. Essential for material balance calculations, pressure transient analysis, and reserve estimation. Co is typically 5-50 × 10⁻⁶ 1/psi.

Parameters:

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

  • api (float, required): Oil API gravity in degrees. Valid: 0-100. Example: 35.0.

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

  • pb (float, required): Bubble point pressure in psia. Must be ≥ 0. Example: 3500.0.

  • sg_g (float, required): Gas specific gravity (air=1). Valid: 0-3. Typical: 0.6-1.2. Example: 0.75.

  • 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.

Compressibility Behavior:

  • p < pb: Co is relatively constant (oil + dissolved gas compressibility)

  • p = pb: Co increases sharply (gas evolution begins)

  • p > pb: Co decreases with pressure (gas compressibility dominates)

Typical Ranges:

  • Undersaturated oil: 5-20 × 10⁻⁶ 1/psi

  • At bubble point: 20-50 × 10⁻⁶ 1/psi

  • Above bubble point: 10-30 × 10⁻⁶ 1/psi

Returns: Dictionary with:

  • value (float or list): Compressibility in 1/psi (matches input p shape)

  • method (str): "McCain"

  • units (str): "1/psi"

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Not providing pb (required for accurate calculation)

  • Using wrong pressure (must be reservoir pressure, not separator)

  • Confusing oil compressibility with gas compressibility

  • Not accounting for dissolved gas effects

Example Usage:

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

Result: Co ≈ 10-15 × 10⁻⁶ 1/psi below bubble point, increases near pb.

Note: Compressibility is critical for material balance calculations. Always provide pb for accurate results. Co values are small (micro-1/psi), so results are typically in scientific notation.

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, the description fully discloses behavior: it explains compressibility trends (p < pb, p = pb, p > pb), typical ranges, criticality of pb, and output structure. It adds context on numerical scale (micro-1/psi) and method used ('McCain'), which aren't in the schema.

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?

Well-structured with sections (CRITICAL PVT PROPERTY, Parameters, Compressibility Behavior, etc.), but slightly verbose. Every sentence adds value (e.g., typical ranges, common mistakes), though some redundancy exists (e.g., repeating pb importance). It's front-loaded with key information.

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 annotations, 0% schema coverage, and an output schema, the description is highly complete: it covers purpose, usage, parameters, behavior, returns, examples, and pitfalls. The output schema handles return values, so the description appropriately focuses on context and semantics.

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 compensates fully: it details each parameter (p, api, degf, pb, sg_g, rs, rsb) with meanings, valid ranges, examples, and interactions (e.g., rs matching p shape, rsb required if pb provided). This adds significant value beyond the bare 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 calculates oil compressibility (Co), specifying it's a critical PVT property that measures volume change with pressure. It distinguishes from siblings like gas_compressibility by focusing on oil and mentions specific applications (material balance, pressure transient analysis).

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

Usage Guidelines5/5

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

Explicit guidance is provided: it states when to use (essential for material balance calculations, etc.), distinguishes from gas compressibility, and warns against common mistakes like using wrong pressure types. It also references sibling tools (e.g., oil_bubble_point for pb) implicitly through parameter context.

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