- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.RetrieveToolSchemaResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#body.aspect_1)

Retrieve the schema of the given tool. The schema is computed on the fly for the given instance of the tool.

### HTTP request

`POST https://ces.googleapis.com/v1/{parent=projects/*/locations/*/apps/*}:retrieveToolSchema`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The resource name of the app which the tool/toolset belongs to. Format: `projects/{project}/locations/{location}/apps/{app}` |

### Request body

The request 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: "tool": string, "toolsetTool": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Message#ToolsetTool`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The identifier of the tool to retrieve the schema for. It could be either a persisted tool or a tool from a toolset. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `tool` | `string` Optional. The name of the tool to retrieve the schema for. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool} |
| `toolsetTool` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Message#ToolsetTool`)`` Optional. The toolset tool to retrieve the schema for. Only one tool should match the predicate from the toolset. Otherwise, an error will be returned. |
| End of mutually exclusive fields. ||

### Response body

Response message for `https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/projects.locations.apps/retrieveToolSchema#google.cloud.ces.v1.ToolService.RetrieveToolSchema`.

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

| JSON representation |
|---|
| ``` { "inputSchema": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Schema`) }, "outputSchema": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Schema`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "tool": string, "toolsetTool": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Message#ToolsetTool`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `inputSchema` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Schema`)`` The schema of the tool input parameters. |
| `outputSchema` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Schema`)`` The schema of the tool output parameters. |
| The identifier of the tool that the schema is for. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `tool` | `string` The name of the tool that the schema is for. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` |
| `toolsetTool` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/Message#ToolsetTool`)`` The toolset tool that the schema is for. |
| 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/ces`

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 `parent` resource:

- `ces.tools.get`

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