Reporting and LLM agents

Hand interpreted wells to people and to LLM tools.

Context for LLMs

petrophys.reporting.context

Compact, size-bounded JSON summaries of wells and results for LLMs and other tools.

build_context

Build a deterministic JSON-safe summary of a well or workflow result.

export_context

Write a well summary or a fully computed context package.

ContextSizeError

A context exceeds its explicitly configured UTF-8 byte budget.

Context for LLMs reference · 2 functions · 1 class

Function schema

petrophys.function_schema

What each parameter of the analysis functions takes, as data: for agents, user interfaces and MCP clients.

check

Return every problem with the declarations; an empty list when none.

declaration

Return the declaration of a public analysis function, or None.

describe

Describe a public analysis function's parameters as plain data.

public_functions

Return every public function defined in the modules of SCOPE.

Function schema reference · 4 functions · 2 classes · 2 constants

Exports and delivery packages

petrophys.reporting

Delivery packages, audit reports, and interpretation exports.

list_context_profiles

Return the canonical context profile names.

describe_context_profile

Return JSON-safe profile metadata.

get_context_profile

Return a context profile by name, accepting its short alias.

identify_context_profile

The context profile whose wells the input files (or well_names) are, else None.

Exports and delivery packages reference · 17 functions · 2 classes

MCP server

petrophys.mcp

The MCP server for LLM clients. Install with pip install "petrophys[mcp]" and run petrophys-mcp; see LLM agents (MCP).

create_server

Build the Petrophys MCP server.

main

Command-line entry point: petrophys-mcp [--root DIR ...].

Session

Wells and interpretation results held by one MCP server process.

SessionError

A request refers to an unknown object or a disallowed path.

MCP server reference · 2 functions · 2 classes · 1 constant