Skip to content

list_libraries

List the libraries saved under Settings > Libraries, and how a run_sql query writes their tables.

A library gives a database connection, a schema or a table, a local folder or file, or a cloud folder or object a name of its own. Every run_sql call can read the saved libraries by that name, together with data and with each other, and a query of libraries alone needs no path. This tool reads Octa's own settings and connects to nothing, so it is safe to call first.

Read-only, and kept when the server runs with --mcp-read-only.

Input schema

None.

Result

{
  "count": 3,
  "libraries": [
    {
      "name": "sales",
      "kind": "database",
      "source": "warehouse sales",
      "write_as": "sales.<table>",
      "fetch_all": false,
      "subfolders": "off",
      "problem": null
    },
    {
      "name": "raw",
      "kind": "folder",
      "source": "/data/exports",
      "write_as": "raw.<table>",
      "fetch_all": false,
      "subfolders": "off",
      "problem": null
    },
    {
      "name": "big_orders",
      "kind": "file",
      "source": "/data/orders_2026.parquet",
      "write_as": "big_orders",
      "fetch_all": false,
      "subfolders": "off",
      "problem": null
    }
  ]
}
  • kind is database, folder, file or cloud.
  • write_as is how a query names the tables: the bare name for a single table or file, name.<table> for a schema or folder, and name.<schema>.<table> for a whole database with schemas.
  • fetch_all lifts the row limit for the tables a library has to copy.
  • subfolders says how a folder library reads the folders below it: off (only its own files), files (every file, its folder the schema), folders (each folder one table), names (files of one name one table) or one_table (the whole folder, also a Delta, Iceberg or Lance table). See Subfolders.
  • problem says why a library cannot be used (a name another library already has, a connection that was removed); write_as is then null and run_sql leaves it out.

Querying them

{
  "name": "run_sql",
  "arguments": {
    "query": "SELECT r.*, s.region FROM raw.orders r JOIN sales.customers s USING (customer_id)"
  }
}

Only the libraries a query names are reached, and only when it runs. A library that could not be used says why in the answer's library_notes, and the query then fails on the name it could not find. A table that the row limit cut is reported like a cut file read, in initial_load_capped and initial_load_note. A name an extra_tables or attach entry of the same call uses wins over a saved library of that name.

On a read-only server the query is still sealed: the libraries' own files stay readable, and nothing else on disk is.

See also