---
title: "POST /v1/{+parent}:executeTool"
method: POST
path: "/v1/{+parent}:executeTool"
tags: ["projects"]
---

# POST /v1/{+parent}:executeTool

`POST /v1/{+parent}:executeTool`

Executes the given tool with the given arguments.

## Path parameters

- `parent` string, required

## Request body

- ExecuteToolRequest — Request message for ToolService.ExecuteTool.
  - `tool` string — Optional. The name of the tool to execute. Format: projects/{project}/locations/{location}/apps/{app}/tools/{tool}
  - `variables` object — Optional. The variables that are available for the tool execution.
  - `toolsetTool` ToolsetTool — A tool that is created from a toolset.
    - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
    - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
  - `mockConfig` MockConfig — Mock tool calls configuration for the session.
    - `mockedToolCalls` MockedToolCall[] — Optional. All tool calls to mock for the duration of the session.
      - `toolset` ToolsetTool — A tool that is created from a toolset.
        - `toolset` string — Required. The resource name of the Toolset from which this tool is derived. Format: `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
        - `toolId` string — Optional. The tool ID to filter the tools to retrieve the schema for.
      - `expectedArgsPattern` object — Required. A pattern to match against the args / inputs of all dispatched tool calls. If the tool call inputs match this pattern, then mock output will be returned.
      - `tool` string — Optional. Deprecated. Use tool_identifier instead.
      - `toolId` string — Optional. The name of the tool to mock. Format: `projects/{project}/locations/{location}/apps/{app}/tools/{tool}`
      - `mockResponse` object — Optional. The mock response / output to return if the tool call args / inputs match the pattern.
    - `unmatchedToolCallBehavior` 'UNMATCHED_TOOL_CALL_BEHAVIOR_UNSPECIFIED' | 'FAIL' | 'PASS_THROUGH' — Required. Beavhior for tool calls that don't match any args patterns in mocked_tool_calls.
  - `context` object — Optional. The [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment for details) to be passed to the Python tool.
  - `args` object — Optional. The input parameters and values for the tool in JSON object format.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/ces.md) · [All operations](https://skmtc.net/google/apis/ces/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/ces/versions/429598666166/schema)
