# MCP Tools Reference: datastream

## Tool: `get_stream_object`

Get details of the stream object specified by the provided resource `name` parameter.

- The resource `name` parameter is in the form: `projects/{project name}/locations/{location}/streams/{stream name}/objects/{stream object name}`, for example: `projects/my-project/locations/us-central1/streams/my-stream/objects/my-stream-object`.

The following sample demonstrate how to use `curl` to invoke the `get_stream_object` MCP tool.

| Curl Request |
|---|
| ```bash curl --location 'https://datastream.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_stream_object", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' ``` |

## Input Schema

Request for fetching a specific stream object.

### GetStreamObjectRequest

| JSON representation |
|---|
| ``` { "name": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The name of the stream object resource to get. |

## Output Schema

A specific stream object (e.g a specific DB table).

### StreamObject

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "displayName": string, "errors": [ { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.Error`) } ], "backfillJob": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_stream_objects#Output.Schema.BackfillJob`) }, "sourceObject": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SourceObjectIdentifier`) }, "customizationRules": [ { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.CustomizationRule`) } ] } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Identifier. The object resource's name. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The creation time of the object. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The last update time of the object. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `displayName` | `string` Required. Display name. |
| `errors[]` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.Error`)`` Output only. Active errors on the object. |
| `backfillJob` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_stream_objects#Output.Schema.BackfillJob`)`` The latest backfill job that was initiated for the stream object. |
| `sourceObject` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SourceObjectIdentifier`)`` The object identifier in the data source. |
| `customizationRules[]` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.CustomizationRule`)`` Output only. The customization rules for the object. These rules are derived from the parent Stream's `rule_sets` and represent the intended configuration for the object. |

### Timestamp

| JSON representation |
|---|
| ``` { "seconds": string, "nanos": integer } ``` |

| Fields ||
|---|---|
| `seconds` | `string (https://developers.google.com/discovery/v1/type-format format)` Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
| `nanos` | `integer` Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |

### Error

| JSON representation |
|---|
| ``` { "reason": string, "errorUuid": string, "message": string, "errorTime": string, "details": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `reason` | `string` A title that explains the reason for the error. |
| `errorUuid` | `string` A unique identifier for this specific error, allowing it to be traced throughout the system in logs and API responses. |
| `message` | `string` A message containing more information about the error that occurred. |
| `errorTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time when the error occurred. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `details` | `map (key: string, value: string)` Additional information about the error. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### DetailsEntry

| JSON representation |
|---|
| ``` { "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `key` | `string` |
| `value` | `string` |

### BackfillJob

| JSON representation |
|---|
| ``` { "state": enum (`State`), "trigger": enum (`Trigger`), "lastStartTime": string, "lastEndTime": string, "errors": [ { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.Error`) } ] } ``` |

| Fields ||
|---|---|
| `state` | ``enum (`State`)`` Output only. Backfill job state. |
| `trigger` | ``enum (`Trigger`)`` Backfill job's triggering reason. |
| `lastStartTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Backfill job's start time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `lastEndTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Backfill job's end time. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `errors[]` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.Error`)`` Output only. Errors which caused the backfill job to fail. |

### SourceObjectIdentifier

| JSON representation |
|---|
| ``` { // Union field `source_identifier` can be only one of the following: "oracleIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.OracleObjectIdentifier`) }, "mysqlIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.MysqlObjectIdentifier`) }, "postgresqlIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.PostgresqlObjectIdentifier`) }, "sqlServerIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SqlServerObjectIdentifier`) }, "salesforceIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SalesforceObjectIdentifier`) }, "mongodbIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.MongodbObjectIdentifier`) }, "spannerIdentifier": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SpannerObjectIdentifier`) } // End of list of possible types for union field `source_identifier`. } ``` |

| Fields ||
|---|---|
| Union field `source_identifier`. The identifier for an object in the data source. `source_identifier` can be only one of the following: ||
| `oracleIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.OracleObjectIdentifier`)`` Oracle data source object identifier. |
| `mysqlIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.MysqlObjectIdentifier`)`` Mysql data source object identifier. |
| `postgresqlIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.PostgresqlObjectIdentifier`)`` PostgreSQL data source object identifier. |
| `sqlServerIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SqlServerObjectIdentifier`)`` SQLServer data source object identifier. |
| `salesforceIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SalesforceObjectIdentifier`)`` Salesforce data source object identifier. |
| `mongodbIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.MongodbObjectIdentifier`)`` MongoDB data source object identifier. |
| `spannerIdentifier` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.SpannerObjectIdentifier`)`` Spanner data source object identifier. |

### OracleObjectIdentifier

| JSON representation |
|---|
| ``` { "schema": string, "table": string } ``` |

| Fields ||
|---|---|
| `schema` | `string` Required. The schema name. |
| `table` | `string` Required. The table name. |

### MysqlObjectIdentifier

| JSON representation |
|---|
| ``` { "database": string, "table": string } ``` |

| Fields ||
|---|---|
| `database` | `string` Required. The database name. |
| `table` | `string` Required. The table name. |

### PostgresqlObjectIdentifier

| JSON representation |
|---|
| ``` { "schema": string, "table": string } ``` |

| Fields ||
|---|---|
| `schema` | `string` Required. The schema name. |
| `table` | `string` Required. The table name. |

### SqlServerObjectIdentifier

| JSON representation |
|---|
| ``` { "schema": string, "table": string } ``` |

| Fields ||
|---|---|
| `schema` | `string` Required. The schema name. |
| `table` | `string` Required. The table name. |

### SalesforceObjectIdentifier

| JSON representation |
|---|
| ``` { "objectName": string } ``` |

| Fields ||
|---|---|
| `objectName` | `string` Required. The object name. |

### MongodbObjectIdentifier

| JSON representation |
|---|
| ``` { "database": string, "collection": string } ``` |

| Fields ||
|---|---|
| `database` | `string` Required. The database name. |
| `collection` | `string` Required. The collection name. |

### SpannerObjectIdentifier

| JSON representation |
|---|
| ``` { "schema": string, "table": string } ``` |

| Fields ||
|---|---|
| `schema` | `string` Optional. The schema name. |
| `table` | `string` Required. The table name. |

### CustomizationRule

| JSON representation |
|---|
| ``` { // Union field `rule` can be only one of the following: "bigqueryPartitioning": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.BigQueryPartitioning`) }, "bigqueryClustering": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.BigQueryClustering`) } // End of list of possible types for union field `rule`. } ``` |

| Fields ||
|---|---|
| Union field `rule`. The rule to apply. `rule` can be only one of the following: ||
| `bigqueryPartitioning` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.BigQueryPartitioning`)`` BigQuery partitioning rule. |
| `bigqueryClustering` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.BigQueryClustering`)`` BigQuery clustering rule. |

### BigQueryPartitioning

| JSON representation |
|---|
| ``` { "requirePartitionFilter": boolean, // Union field `partitioning` can be only one of the following: "integerRangePartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.IntegerRangePartition`) }, "timeUnitPartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.TimeUnitPartition`) }, "ingestionTimePartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.IngestionTimePartition`) } // End of list of possible types for union field `partitioning`. } ``` |

| Fields ||
|---|---|
| `requirePartitionFilter` | `boolean` Optional. If true, queries over the table require a partition filter. |
| Union field `partitioning`. Partitioning to apply on the table. `partitioning` can be only one of the following: ||
| `integerRangePartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.IntegerRangePartition`)`` Integer range partitioning. |
| `timeUnitPartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.TimeUnitPartition`)`` Time unit column partitioning. |
| `ingestionTimePartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/mcp/tools_list/list_streams#Output.Schema.IngestionTimePartition`)`` Ingestion time partitioning. |

### IntegerRangePartition

| JSON representation |
|---|
| ``` { "column": string, "start": string, "end": string, "interval": string } ``` |

| Fields ||
|---|---|
| `column` | `string` Required. The partitioning column. |
| `start` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The starting value for range partitioning (inclusive). |
| `end` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The ending value for range partitioning (exclusive). |
| `interval` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The interval of each range within the partition. |

### TimeUnitPartition

| JSON representation |
|---|
| ``` { "column": string, "partitioningTimeGranularity": enum (`PartitioningTimeGranularity`) } ``` |

| Fields ||
|---|---|
| `column` | `string` Required. The partitioning column. |
| `partitioningTimeGranularity` | ``enum (`PartitioningTimeGranularity`)`` Optional. Partition granularity. |

### IngestionTimePartition

| JSON representation |
|---|
| ``` { "partitioningTimeGranularity": enum (`PartitioningTimeGranularity`) } ``` |

| Fields ||
|---|---|
| `partitioningTimeGranularity` | ``enum (`PartitioningTimeGranularity`)`` Optional. Partition granularity |

### BigQueryClustering

| JSON representation |
|---|
| ``` { "columns": [ string ] } ``` |

| Fields ||
|---|---|
| `columns[]` | `string` Required. Column names to set as clustering columns. |

### Tool Annotations

Destructive Hint: ❌ \| Idempotent Hint: ✅ \| Read Only Hint: ✅ \| Open World Hint: ❌