MCP Tools Reference: spanner.googleapis.com

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

string

Required. The database whose schema we wish to get. Values are of the formprojects/<project>/instances/<instance>/databases/<database>

Output Schema

The response forGetDatabaseDdl.

GetDatabaseDdlResponse

JSON representation
{"statements":[string],"protoDescriptors":string}
Fields
statements[]

string

A list of formatted DDL statements defining the schema of the database specified in the request.

protoDescriptors

string (bytes format)

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.