MCP Tools Reference: spanner.googleapis.com Stay organized with collections Save and categorize content based on your preferences.
Tool:get_database_ddl
Get database schema for a given database.
The following sample demonstrate how to usecurl to invoke theget_database_ddl MCP tool.
| Curl Request |
|---|
curl--location'https://spanner.googleapis.com/mcp'\--header'content-type: application/json'\--header'accept: application/json, text/event-stream'\--data'{ "method": "tools/call", "params": { "name": "get_database_ddl", "arguments": { // provide these details according to the tool'sMCPspecification}},"jsonrpc":"2.0","id":1}' |
Input Schema
The request forGetDatabaseDdl.
GetDatabaseDdlRequest
| JSON representation |
|---|
{"database":string} |
| Fields | |
|---|---|
database |
Required. The database whose schema we wish to get. Values are of the form |
Output Schema
The response forGetDatabaseDdl.
GetDatabaseDdlResponse
| JSON representation |
|---|
{"statements":[string],"protoDescriptors":string} |
| Fields | |
|---|---|
statements[] |
A list of formatted DDL statements defining the schema of the database specified in the request. |
protoDescriptors |
Proto descriptors stored in the database. Contains a protobuf-serializedgoogle.protobuf.FileDescriptorSet. For more details, see protobufferself description. A base64-encoded string. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ✅ | Open World Hint: ❌
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-11 UTC.