Tool: update_topic
Update an existing Cloud Pub/Sub topic.
Parameters
topic: The topic object containing fields to update. Thenamefield within thetopicobject must be set to the name of the topic to be updated, and must be in the formatprojects/{project_id}/topics/{topic_name}.update_mask: The set of fields to update for the topic.
Returns
- The updated topic configuration.
Important Notes
A topic is a named resource that represents a feed of messages.
A project ID and topic name must be provided.
Certain properties of a topic, such as its name, are not modifiable.
The following sample demonstrate how to use curl to invoke the update_topic MCP tool.
| Curl Request |
|---|
curl --location 'https://pubsub.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "update_topic", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request for the UpdateTopic method.
UpdateTopicRequest
| JSON representation |
|---|
{
"topic": {
object ( |
| Fields | |
|---|---|
topic |
Required. The updated topic object. |
updateMask |
Required. Indicates which fields in the provided topic to update. Must be specified and non-empty. Note that if This is a comma-separated list of fully qualified names of fields. Example: |
Topic
| JSON representation |
|---|
{ "name": string, "labels": { string: string, ... }, "messageStoragePolicy": { object ( |
| Fields | |
|---|---|
name |
Required. Identifier. The name of the topic. It must have the format |
labels |
Optional. See Creating and managing labels. An object containing a list of |
messageStoragePolicy |
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. |
kmsKeyName |
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is |
schemaSettings |
Optional. Settings for validating messages published against a schema. |
satisfiesPzs |
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests. |
messageRetentionDuration |
Optional. Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last A duration in seconds with up to nine fractional digits, ending with ' |
state |
Output only. An output-only field indicating the state of the topic. |
ingestionDataSourceSettings |
Optional. Settings for ingestion from a data source into this topic. |
messageTransforms[] |
Optional. Transforms to be applied to messages published to the topic. Transforms are applied in the order specified. |
tags |
Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" An object containing a list of |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
MessageStoragePolicy
| JSON representation |
|---|
{ "allowedPersistenceRegions": [ string ], "enforceInTransit": boolean } |
| Fields | |
|---|---|
allowedPersistenceRegions[] |
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration. |
enforceInTransit |
Optional. If true, |
SchemaSettings
| JSON representation |
|---|
{
"schema": string,
"encoding": enum ( |
| Fields | |
|---|---|
schema |
Required. The name of the schema that messages published should be validated against. Format is |
encoding |
Optional. The encoding of messages validated against |
firstRevisionId |
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before. |
lastRevisionId |
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after. |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
IngestionDataSourceSettings
| JSON representation |
|---|
{ "platformLogsSettings": { object ( |
| Fields | |
|---|---|
platformLogsSettings |
Optional. Platform Logs settings. If unset, no Platform Logs will be generated. |
Union field source. Only one source type can have settings set. source can be only one of the following: |
|
awsKinesis |
Optional. Amazon Kinesis Data Streams. |
cloudStorage |
Optional. Cloud Storage. |
azureEventHubs |
Optional. Azure Event Hubs. |
awsMsk |
Optional. Amazon MSK. |
confluentCloud |
Optional. Confluent Cloud. |
AwsKinesis
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Kinesis ingestion source. |
streamArn |
Required. The Kinesis stream ARN to ingest data from. |
consumerArn |
Required. The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used. |
awsRoleArn |
Required. AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with Kinesis (via a |
CloudStorage
| JSON representation |
|---|
{ "state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Cloud Storage ingestion source. |
bucket |
Optional. Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements. |
minimumObjectCreateTime |
Optional. Only objects with a larger or equal creation timestamp will be ingested. 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: |
matchGlob |
Optional. Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns. |
Union field input_format. Defaults to text format. input_format can be only one of the following: |
|
textFormat |
Optional. Data from Cloud Storage will be interpreted as text. |
avroFormat |
Optional. Data from Cloud Storage will be interpreted in Avro format. |
pubsubAvroFormat |
Optional. It will be assumed data from Cloud Storage was written via Cloud Storage subscriptions. |
TextFormat
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
delimiter |
Optional. When unset, '\n' is used. |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
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 |
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. |
AzureEventHubs
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Event Hubs ingestion source. |
resourceGroup |
Optional. Name of the resource group within the azure subscription. |
namespace |
Optional. The name of the Event Hubs namespace. |
eventHub |
Optional. The name of the Event Hub. |
clientId |
Optional. The client id of the Azure application that is being used to authenticate Pub/Sub. |
tenantId |
Optional. The tenant id of the Azure application that is being used to authenticate Pub/Sub. |
subscriptionId |
Optional. The Azure subscription id. |
gcpServiceAccount |
Optional. The GCP service account to be used for Federated Identity authentication. |
AwsMsk
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Amazon MSK ingestion source. |
clusterArn |
Required. The Amazon Resource Name (ARN) that uniquely identifies the cluster. |
topic |
Required. The name of the topic in the Amazon MSK cluster that Pub/Sub will import from. |
awsRoleArn |
Required. AWS role ARN to be used for Federated Identity authentication with Amazon MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with Amazon MSK (via a |
ConfluentCloud
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Confluent Cloud ingestion source. |
bootstrapServer |
Required. The address of the bootstrap server. The format is url:port. |
clusterId |
Required. The id of the cluster. |
topic |
Required. The name of the topic in the Confluent Cloud cluster that Pub/Sub will import from. |
identityPoolId |
Required. The id of the identity pool to be used for Federated Identity authentication with Confluent Cloud. See https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/identity-pools.html#add-oauth-identity-pools. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with |
PlatformLogsSettings
| JSON representation |
|---|
{
"severity": enum ( |
| Fields | |
|---|---|
severity |
Optional. The minimum severity level of Platform Logs that will be written. |
MessageTransform
| JSON representation |
|---|
{ "enabled": boolean, "disabled": boolean, // Union field |
| Fields | |
|---|---|
enabled |
Optional. This field is deprecated, use the |
disabled |
Optional. If true, the transform is disabled and will not be applied to messages. Defaults to |
Union field
|
|
javascriptUdf |
Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's are specified on a resource, each must have a unique |
aiInference |
Optional. AI Inference. Specifies the Vertex AI endpoint that inference requests built from the Pub/Sub message data and provided parameters will be sent to. |
JavaScriptUDF
| JSON representation |
|---|
{ "functionName": string, "code": string } |
| Fields | |
|---|---|
functionName |
Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
code |
Required. JavaScript code that contains a function |
AIInference
| JSON representation |
|---|
{ "endpoint": string, "serviceAccountEmail": string, // Union field |
| Fields | |
|---|---|
endpoint |
Required. An endpoint to a Vertex AI model of the form |
serviceAccountEmail |
Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have |
Union field inference_mode. The format of inference requests made to the endpoint. inference_mode can be only one of the following: |
|
unstructuredInference |
Optional. Requests and responses can be any arbitrary JSON object. |
UnstructuredInference
| JSON representation |
|---|
{ "parameters": { object } } |
| Fields | |
|---|---|
parameters |
Optional. A parameters object to be included in each inference request. The parameters object is combined with the data field of the Pub/Sub message to form the inference request. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
FieldMask
| JSON representation |
|---|
{ "paths": [ string ] } |
| Fields | |
|---|---|
paths[] |
The set of field mask paths. |
Output Schema
A topic resource.
Topic
| JSON representation |
|---|
{ "name": string, "labels": { string: string, ... }, "messageStoragePolicy": { object ( |
| Fields | |
|---|---|
name |
Required. Identifier. The name of the topic. It must have the format |
labels |
Optional. See Creating and managing labels. An object containing a list of |
messageStoragePolicy |
Optional. Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. |
kmsKeyName |
Optional. The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. The expected format is |
schemaSettings |
Optional. Settings for validating messages published against a schema. |
satisfiesPzs |
Optional. Reserved for future use. This field is set only in responses from the server; it is ignored if it is set in any requests. |
messageRetentionDuration |
Optional. Indicates the minimum duration to retain a message after it is published to the topic. If this field is set, messages published to the topic in the last A duration in seconds with up to nine fractional digits, ending with ' |
state |
Output only. An output-only field indicating the state of the topic. |
ingestionDataSourceSettings |
Optional. Settings for ingestion from a data source into this topic. |
messageTransforms[] |
Optional. Transforms to be applied to messages published to the topic. Transforms are applied in the order specified. |
tags |
Optional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing" An object containing a list of |
LabelsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
MessageStoragePolicy
| JSON representation |
|---|
{ "allowedPersistenceRegions": [ string ], "enforceInTransit": boolean } |
| Fields | |
|---|---|
allowedPersistenceRegions[] |
Optional. A list of IDs of Google Cloud regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed Google Cloud regions (or running outside of Google Cloud altogether) are routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration. |
enforceInTransit |
Optional. If true, |
SchemaSettings
| JSON representation |
|---|
{
"schema": string,
"encoding": enum ( |
| Fields | |
|---|---|
schema |
Required. The name of the schema that messages published should be validated against. Format is |
encoding |
Optional. The encoding of messages validated against |
firstRevisionId |
Optional. The minimum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against last_revision or any revision created before. |
lastRevisionId |
Optional. The maximum (inclusive) revision allowed for validating messages. If empty or not present, allow any revision to be validated against first_revision or any revision created after. |
Duration
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
nanos |
Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 |
IngestionDataSourceSettings
| JSON representation |
|---|
{ "platformLogsSettings": { object ( |
| Fields | |
|---|---|
platformLogsSettings |
Optional. Platform Logs settings. If unset, no Platform Logs will be generated. |
Union field source. Only one source type can have settings set. source can be only one of the following: |
|
awsKinesis |
Optional. Amazon Kinesis Data Streams. |
cloudStorage |
Optional. Cloud Storage. |
azureEventHubs |
Optional. Azure Event Hubs. |
awsMsk |
Optional. Amazon MSK. |
confluentCloud |
Optional. Confluent Cloud. |
AwsKinesis
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Kinesis ingestion source. |
streamArn |
Required. The Kinesis stream ARN to ingest data from. |
consumerArn |
Required. The Kinesis consumer ARN to used for ingestion in Enhanced Fan-Out mode. The consumer must be already created and ready to be used. |
awsRoleArn |
Required. AWS role ARN to be used for Federated Identity authentication with Kinesis. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with Kinesis (via a |
CloudStorage
| JSON representation |
|---|
{ "state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Cloud Storage ingestion source. |
bucket |
Optional. Cloud Storage bucket. The bucket name must be without any prefix like "gs://". See the bucket naming requirements. |
minimumObjectCreateTime |
Optional. Only objects with a larger or equal creation timestamp will be ingested. 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: |
matchGlob |
Optional. Glob pattern used to match objects that will be ingested. If unset, all objects will be ingested. See the supported patterns. |
Union field input_format. Defaults to text format. input_format can be only one of the following: |
|
textFormat |
Optional. Data from Cloud Storage will be interpreted as text. |
avroFormat |
Optional. Data from Cloud Storage will be interpreted in Avro format. |
pubsubAvroFormat |
Optional. It will be assumed data from Cloud Storage was written via Cloud Storage subscriptions. |
TextFormat
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field
|
|
delimiter |
Optional. When unset, '\n' is used. |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
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 |
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. |
AzureEventHubs
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Event Hubs ingestion source. |
resourceGroup |
Optional. Name of the resource group within the azure subscription. |
namespace |
Optional. The name of the Event Hubs namespace. |
eventHub |
Optional. The name of the Event Hub. |
clientId |
Optional. The client id of the Azure application that is being used to authenticate Pub/Sub. |
tenantId |
Optional. The tenant id of the Azure application that is being used to authenticate Pub/Sub. |
subscriptionId |
Optional. The Azure subscription id. |
gcpServiceAccount |
Optional. The GCP service account to be used for Federated Identity authentication. |
AwsMsk
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Amazon MSK ingestion source. |
clusterArn |
Required. The Amazon Resource Name (ARN) that uniquely identifies the cluster. |
topic |
Required. The name of the topic in the Amazon MSK cluster that Pub/Sub will import from. |
awsRoleArn |
Required. AWS role ARN to be used for Federated Identity authentication with Amazon MSK. Check the Pub/Sub docs for how to set up this role and the required permissions that need to be attached to it. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with Amazon MSK (via a |
ConfluentCloud
| JSON representation |
|---|
{
"state": enum ( |
| Fields | |
|---|---|
state |
Output only. An output-only field that indicates the state of the Confluent Cloud ingestion source. |
bootstrapServer |
Required. The address of the bootstrap server. The format is url:port. |
clusterId |
Required. The id of the cluster. |
topic |
Required. The name of the topic in the Confluent Cloud cluster that Pub/Sub will import from. |
identityPoolId |
Required. The id of the identity pool to be used for Federated Identity authentication with Confluent Cloud. See https://docs.confluent.io/cloud/current/security/authenticate/workload-identities/identity-providers/oauth/identity-pools.html#add-oauth-identity-pools. |
gcpServiceAccount |
Required. The GCP service account to be used for Federated Identity authentication with |
PlatformLogsSettings
| JSON representation |
|---|
{
"severity": enum ( |
| Fields | |
|---|---|
severity |
Optional. The minimum severity level of Platform Logs that will be written. |
MessageTransform
| JSON representation |
|---|
{ "enabled": boolean, "disabled": boolean, // Union field |
| Fields | |
|---|---|
enabled |
Optional. This field is deprecated, use the |
disabled |
Optional. If true, the transform is disabled and will not be applied to messages. Defaults to |
Union field
|
|
javascriptUdf |
Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's are specified on a resource, each must have a unique |
aiInference |
Optional. AI Inference. Specifies the Vertex AI endpoint that inference requests built from the Pub/Sub message data and provided parameters will be sent to. |
JavaScriptUDF
| JSON representation |
|---|
{ "functionName": string, "code": string } |
| Fields | |
|---|---|
functionName |
Required. Name of the JavasScript function that should applied to Pub/Sub messages. |
code |
Required. JavaScript code that contains a function |
AIInference
| JSON representation |
|---|
{ "endpoint": string, "serviceAccountEmail": string, // Union field |
| Fields | |
|---|---|
endpoint |
Required. An endpoint to a Vertex AI model of the form |
serviceAccountEmail |
Optional. The service account to use to make prediction requests against endpoints. The resource creator or updater that specifies this field must have |
Union field inference_mode. The format of inference requests made to the endpoint. inference_mode can be only one of the following: |
|
unstructuredInference |
Optional. Requests and responses can be any arbitrary JSON object. |
UnstructuredInference
| JSON representation |
|---|
{ "parameters": { object } } |
| Fields | |
|---|---|
parameters |
Optional. A parameters object to be included in each inference request. The parameters object is combined with the data field of the Pub/Sub message to form the inference request. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a null value. |
numberValue |
Represents a double value. |
stringValue |
Represents a string value. |
boolValue |
Represents a boolean value. |
structValue |
Represents a structured value. |
listValue |
Represents a repeated |
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
TagsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Tool Annotations
Destructive Hint: ✅ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ✅