get_ddl
Return the DDL definition of an Oracle object as a CLOB string without executing it. Specify the object name and type (and schema when needed) to retrieve creation SQL.
Instructions
Return the DDL definition of an object as a CLOB string, using DBMS_METADATA.GET_DDL. Read-only: never executes the DDL. All three parameters (schema, name, type) are REQUIRED. Valid type values: TABLE, VIEW, INDEX, SEQUENCE, PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, TRIGGER, TYPE, SYNONYM, DB LINK. schema/name/type are matched case-insensitively against ALL_OBJECTS (lowercase is fine) and the exact stored object is passed to GET_DDL, so a case mismatch never surfaces as ORA-31603. Requires SELECT_CATALOG_ROLE plus EXECUTE on SYS.DBMS_METADATA (granted in db/setup_least_privilege_user.sql); privilege or not-found failures surface as error results.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"type": "<type>"
},
"name": "get_ddl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Object name. | |
| type | Yes | Object type, e.g. 'TABLE', 'VIEW', 'INDEX', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'SEQUENCE', 'TRIGGER'. | |
| schema | No | Schema (owner) of the object. Optional — defaults to the server's current schema; omit rather than guess. |