mcpField
P
pythia-explore

pythia-explore

github.com/thaildhe172591Data & databases4142 installsUpdated 4d ago
Repository

About pythia-explore

pythia-explore is a skill for developers investigating live database schemas and PL/SQL objects. It prioritizes querying the database over relying on potentially stale SQL exports, with commands for source, dependencies, usages, and errors.

Key features

  1. 01Inspect live schema and connection
  2. 02Read object source and signatures
  3. 03Explore columns and DDL
  4. 04Trace dependencies and impact
  5. 05Find exact identifier usages
  6. 06Check invalid objects and errors

Use cases

  1. 01Verify a SQL export against the live database
  2. 02Understand a procedure or function
  3. 03Find where a database object is used

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thaildhe172591/pythia --skill pythia-explore

After installing, type/pythia-explorein Claude Code to confirm it loaded.

Bundled filesreference/data-dictionary.md

Details

From the project README

Exploring the Schema

Announce at start: "Using pythia-explore — asking the database directly."

Phase: Learn

The principle: ask the database, never the dump

Repositories of exported .sql files go stale the day after export. A real mid-size system, audited in 2026, compared its repo dump against the live database:

Object typeIn the dumpIn the databaseVerdict
Procedures3,8273,827matched
Tables952952matched
Types0115all missing
Packages09all missing
Indexes1161,016~89% missing

Code that "reads fine" against the dump can reference types and packages the dump never heard of.

When the developer hands you a .sql file — "explain this procedure", "here is the export, what does it do" — the file is a claim, not the truth. Read it, then run pythia src <NAME> and answer from the database. If the two differ, say so first: which is newer is exactly what the developer needs to know, and it is invisible from the file alone. Never answer about a database object from a file alone while the database is reachable.

Read files as the answer only when the database is unreachable — and say that is what you are doing.

What you need → what you run

NeedCommand
Is the connection alive, what schemapythia check
Find objects by namepythia ls "PKG_%"
Read source, with the compiler's line numberspythia src NAME (--body, --spec)
A procedure/function signaturepythia args NAME
Columns and real data typespythia cols TABLE_NAME
Full DDLpythia ddl TABLE NAME
Search all PL/SQL textpythia grep "text"
What an object depends onpythia deps NAME
What depends on an objectpythia impact NAME
Exact identifier usages (beats grep)pythia plscope NAME
Programs named like this onepythia similar NAME
Everything currently brokenpythia invalid, pythia errors
A free-form questionpythia sql "select ..." (SELECT/WITH only)

Rules that keep answers honest

  • Truncation is always announced. Outputs end with -- truncated ... or set "truncated": true in --json. If you do not see the marker, you saw everything; if you do, say so or fetch more (--limit, --offset, --max-lines) — never present a truncated list as complete.
  • plscope before grep for "where is X used": PL/Scope is recorded by the compiler and exact; grep matches comments and look-alike names. If PL/Scope has no data, the command says so and grep is the fallback.
  • src line numbers are the compiler's own — an error at line 47 means line 47 in src output. No offset arithmetic.
  • Default output caps exist to protect your context window; raise them only for the object you are actually working on.

Deeper reference — which dictionary views back these commands, PL/Scope enablement, licensing boundaries: reference/data-dictionary.md.

Comments

Markdown supported