Explore the schema · stop 7 of 10

get_ddl

Returns the definition of a table, view, function or index.

Works in read modeTool sets: query · full

You might ask

“Show me the SQL that defines the monthly_revenue view.”

Your assistant may call get_ddl to answer.

How it works

  • Views, materialized views, functions and indexes come back as their CREATE statement.
  • Tables come back as structured DDL: columns, constraints and indexes.

Parameters

objectstringrequired
Object as "schema.name" (e.g. "public.orders"); a bare name is resolved if unambiguous.
connectionIdstring
Optional connection profile override — does not change session context.
databasestring
Database to use instead of the current one, on connectionId or the active connection.
kindstring
Object kind hint: "table", "view", "materialized_view", "function", or "index". Auto-detected if omitted.

What your assistant reads

The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.

Get the DDL / definition of a database object. Views, materialized views, functions, and indexes return their CREATE statement; tables return structured DDL (columns, constraints, indexes).