Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

gas_pressure_from_pz

Calculate reservoir pressure from P/Z values for gas material balance analysis, enabling volumetric reserves estimation and drive mechanism identification.

Instructions

Calculate pressure from P/Z value.

MATERIAL BALANCE TOOL - Solves for pressure given a P/Z (pressure/Z-factor) value. Essential for gas material balance analysis where P/Z vs cumulative production is plotted. Uses iterative solution to find pressure that yields the specified P/Z value.

Parameters:

  • pz (float or list, required): P/Z value(s) in psia. Must be > 0. Can be scalar or array. Example: 5000.0 or [4000, 5000, 6000].

  • sg (float, required): Gas specific gravity (air=1.0). Valid: 0.55-3.0. Typical: 0.6-1.2. Example: 0.7.

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

  • h2s (float, optional, default=0.0): H2S mole fraction (0-1). Typical: 0-0.05. Example: 0.0.

  • co2 (float, optional, default=0.0): CO2 mole fraction (0-1). Typical: 0-0.20. Example: 0.0.

  • n2 (float, optional, default=0.0): N2 mole fraction (0-1). Typical: 0-0.10. Example: 0.0.

  • zmethod (str, optional, default="DAK"): Z-factor method for calculation. Options: "DAK", "HY", "WYW", "BUR". DAK recommended.

P/Z Method Applications:

  • Volumetric Gas Reserves: P/Z vs Gp plot gives GIIP (Gas Initially In Place)

  • Aquifer Influx Detection: Deviation from straight line indicates water drive

  • Drive Mechanism Identification: Volumetric vs water drive vs gas cap

  • Production Forecasting: Extrapolate P/Z to abandonment pressure

Material Balance Principle: For volumetric gas reservoirs: P/Z = (Pi/Zi) × (1 - Gp/G) Where Gp = cumulative production, G = GIIP

A straight line on P/Z vs Gp indicates volumetric depletion. Deviation suggests water influx, changing pore volume, or gas cap expansion.

Solution Method: Iterative Newton-Raphson method to solve: P/Z - pz_target = 0 Converges rapidly for well-posed problems.

Returns: Dictionary with:

  • value (float or list): Pressure in psia (matches input pz shape)

  • method (str): Iterative solution method with Z-factor method

  • units (str): "psia"

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Using separator temperature instead of reservoir temperature

  • Not accounting for non-hydrocarbon fractions

  • Confusing P/Z (pressure/Z-factor) with pressure

  • Using wrong Z-factor method (must match method used in material balance)

  • Temperature in Celsius instead of Fahrenheit

Example Usage:

{
    "pz": 5000.0,
    "sg": 0.7,
    "degf": 180.0,
    "h2s": 0.0,
    "co2": 0.0,
    "n2": 0.0,
    "zmethod": "DAK"
}

Result: Pressure ≈ 4500-5500 psia (depends on Z-factor at that pressure).

Note: P/Z method is fundamental to gas material balance. Always use the same Z-factor method throughout your analysis for consistency. Account for all non-hydrocarbon components as they affect Z-factor and thus P/Z values.

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 the full burden of behavioral disclosure. It thoroughly explains the tool's behavior: it uses an 'iterative Newton-Raphson method' to solve for pressure, returns a dictionary with specific keys (value, method, units, inputs), and includes details on convergence ('Converges rapidly for well-posed problems'), error handling (e.g., parameter validity ranges), and consistency requirements (e.g., using the same Z-factor method throughout analysis).

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 sections like Parameters, P/Z Method Applications, Material Balance Principle, Solution Method, Returns, Common Mistakes, and Example Usage, making it easy to navigate. However, it is quite lengthy with extensive theoretical background (e.g., material balance equations), which, while informative, could be trimmed for more front-loaded conciseness without losing essential guidance.

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?

The description is highly complete for this complex tool with no annotations and an output schema. It covers purpose, usage, parameters, behavior, return values, examples, and common pitfalls. Given the output schema exists (as per context signals), the description appropriately explains the return structure without redundancy, ensuring the agent has all necessary context to invoke the tool correctly.

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?

Given the schema description coverage is 0% (as indicated by context signals), the description fully compensates by providing detailed parameter semantics. It lists all parameters (pz, sg, degf, h2s, co2, n2, zmethod) with clear explanations, valid ranges, typical values, examples, and optional/default settings, adding significant meaning beyond the bare schema properties and required fields.

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 pressure from P/Z value' and 'Solves for pressure given a P/Z (pressure/Z-factor) value.' It specifically distinguishes this as a 'MATERIAL BALANCE TOOL' for gas material balance analysis, differentiating it from sibling tools like gas_z_factor or gas_critical_properties by focusing on iterative pressure calculation from P/Z inputs.

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?

The description provides explicit guidance on when to use this tool: 'Essential for gas material balance analysis where P/Z vs cumulative production is plotted.' It details applications such as volumetric gas reserves, aquifer influx detection, drive mechanism identification, and production forecasting, and warns against common mistakes like using separator temperature or wrong Z-factor methods, offering clear context for proper usage.

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