Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

oil_sg_from_api

Convert oil API gravity to specific gravity for petroleum engineering calculations. Use this tool to transform API degrees into dimensionless specific gravity values essential for reservoir analysis.

Instructions

Convert API gravity to oil specific gravity.

UNIT CONVERSION TOOL - Converts API gravity (degrees) to specific gravity (dimensionless, water=1.0). Specific gravity is the ratio of oil density to water density at standard conditions. Essential for calculations requiring specific gravity.

Parameters:

  • api (float or list, required): Oil API gravity in degrees. Valid range: 0-100. Typical: 20-50. Example: 35.0 or [30, 35, 40]. Can be scalar or array.

Conversion Formula: SG = 141.5 / (API + 131.5)

Specific Gravity Ranges:

  • Heavy oil: SG > 0.922 (API < 22°)

  • Medium oil: SG 0.850-0.922 (API 22-35°)

  • Light oil: SG < 0.850 (API > 35°)

  • Water: SG = 1.0 (API = 10°)

Returns: Dictionary with:

  • value (float or list): Specific gravity (dimensionless, matches input api shape)

  • method (str): "Standard conversion"

  • units (str): "dimensionless (water=1)"

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Using gas API gravity instead of oil API gravity

  • Confusing API gravity with specific gravity (inverse relationship)

  • Not understanding that lower SG = lighter oil (higher API)

  • Using wrong conversion formula

Example Usage:

{
    "api": 35.0
}

Result: SG = 141.5 / (35.0 + 131.5) ≈ 0.850 (medium gravity oil)

Note: Most PVT correlations use API gravity directly, but some require specific gravity. Use this conversion when needed. Remember: API and SG are inversely related - higher API means lower SG (lighter oil).

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: the conversion formula, valid input ranges (0-100), typical ranges (20-50), support for scalar or array inputs, return structure (dictionary with value, method, units, inputs), and specific gravity ranges with oil classifications. It also covers common mistakes and the inverse relationship between API and SG.

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 (UNIT CONVERSION TOOL, Parameters, Conversion Formula, etc.) and front-loads the core purpose. However, it includes some redundant information (e.g., repeating the inverse relationship in multiple places) and the 'Common Mistakes' section, while helpful, adds length. Every sentence earns its place, but minor trimming could improve conciseness.

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 (unit conversion with mathematical formula), no annotations, and 0% schema coverage, the description provides complete context. It explains the conversion physics, provides the formula, input constraints, return format, usage examples, and common pitfalls. The presence of an output schema reduces the need to explain return values, but the description still thoroughly documents the tool's behavior and context.

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 schema only says 'API gravity (degrees) - scalar or array'), the description fully compensates by providing rich parameter semantics. It explains the 'api' parameter as 'Oil API gravity in degrees,' specifies valid range (0-100), typical range (20-50), shows examples (35.0 or [30, 35, 40]), and clarifies it can be scalar or array. This adds substantial meaning 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's purpose: 'Convert API gravity to oil specific gravity.' It specifies the exact conversion (API degrees to specific gravity dimensionless) and distinguishes it from sibling tools like 'oil_api_from_sg' (inverse conversion) and 'oil_sg_from_jacoby' (different method). The description explicitly mentions this is for oil, not gas, further differentiating from gas-related tools.

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 calculations requiring specific gravity' and 'Use this conversion when needed.' It also warns against common mistakes like using gas API gravity instead of oil, and notes that 'Most PVT correlations use API gravity directly, but some require specific gravity.' This gives clear context for when this conversion is necessary versus when to use API gravity directly.

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