- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.InvokeConnectorMcpResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#body.aspect_1)
- [McpError](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#McpError)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#McpError.SCHEMA_REPRESENTATION)

Makes a call to an MCP connector.

### HTTP request

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:invokeConnectorMcp`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections#DataConnector` resource. The data connector used for making the MCP call. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "method": string, "params": { object }, "engine": string, "toolSpecVersion": string } ``` |

| Fields ||
|---|---|
| `method` | `string` Required. The method to invoke (e.g. "tools/list", "tools/call", "resources/read", "prompts/get", etc.). |
| `params` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. Arbitrary structured parameters for the method. Using google.protobuf.Struct keeps the payload schema-flexible, matching JSON-RPC's free-form `params` field. |
| `engine` | `string` Optional. The engine resource name (e.g. "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}"). Used as the search engine ID when invoking tool registry tools that issue Discovery Search Service requests. |
| `toolSpecVersion` | `string` Optional. The tool spec version to resolve the connector's tool surface against. This corresponds to the connector's BAP tool spec file name (e.g. "v2", "v5.2"). When unset, the server uses its default (latest) tool spec for the connector. Applies to all methods (e.g. "tools/list" and "tools/call"). |

### Response body

Response message returning the result of an MCP connector invocation. It contains either a successful result payload or error details.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "result": value, "error": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#McpError`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| Exactly one of `result` or `error` should be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `result` | ``value (`https://protobuf.dev/reference/protobuf/google.protobuf#value` format)`` Successful result --- arbitrary structured data. |
| `error` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.dataConnector/invokeConnectorMcp#McpError`)`` Error details when the call fails. |
| End of mutually exclusive fields. ||

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.assist.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `discoveryengine.dataConnectors.executeAction`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## McpError

McpError represents error details when an MCP call fails. This structure follows the JSON-RPC 2.0 error object shape.

| JSON representation |
|---|
| ``` { "code": integer, "message": string, "data": value } ``` |

| Fields ||
|---|---|
| `code` | `integer` Numeric error code. |
| `message` | `string` Short, human-readable description of the error. |
| `data` | ``value (`https://protobuf.dev/reference/protobuf/google.protobuf#value` format)`` Optional structured data with additional error context. |