> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Execute Tool

> Execute a tool within a chat session (single or batch execution)



## OpenAPI

````yaml /api-reference/openapi.json post /v1/bot/chat/execute-tool
openapi: 3.0.0
info:
  title: BoostGPT API
  version: 1.0.0
  description: API for managing AI agents with memory capabilities
servers:
  - url: https://api.boostgpt.co
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: Agent
    description: Operations for managing AI agents
  - name: Memory
    description: Operations for managing agent memory sources
  - name: Chat
    description: Operations for chatting with agents and managing conversations
  - name: Tools
    description: Operations for managing agent tools and MCP server integrations
  - name: Analytics
    description: Operations for retrieving agent statistics and analytics
  - name: Tasks
    description: >-
      Scheduled tasks — recurring work an agent performs on its own. Replaces
      the Heartbeat API.
  - name: Email
    description: Operations for managing agent email functionality
  - name: Workflows
    description: Operations for managing agent workflow automations
  - name: Workspace
    description: Operations for managing agent workspaces and files
paths:
  /v1/bot/chat/execute-tool:
    post:
      tags:
        - Chat
      summary: Execute Tool
      description: Execute a tool within a chat session (single or batch execution)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteToolRequest'
      responses:
        '200':
          description: Tool executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteToolResponse'
        '400':
          description: Bad request - validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExecuteToolRequest:
      type: object
      required:
        - project_id
        - bot_id
        - chat_id
        - execution_data
      properties:
        project_id:
          type: string
          description: Project ID
        bot_id:
          type: string
          description: Agent ID
        chat_id:
          type: string
          description: Chat ID
        model:
          type: string
          description: Override model for execution
        instruction:
          type: string
          maxLength: 1000
          description: Custom instruction
        chat_mode:
          type: string
          enum:
            - ask
            - edit
            - plan
          description: >-
            Override the chat mode for this step. Omitted, the chat saved mode
            is used.
          default: ask
        execution_data:
          type: object
          required:
            - executionId
            - originalQuery
          properties:
            executionId:
              type: string
              pattern: ^exec_\d+_[a-f0-9-]+$
              description: Execution ID in format exec_timestamp_uuid
            executionType:
              type: string
              enum:
                - SINGLE
                - BATCH
              default: SINGLE
              description: Type of execution - single tool or batch
            originalQuery:
              type: string
              minLength: 1
              maxLength: 2000
              description: Original user query
            context:
              type: string
              maxLength: 5000
              description: Execution context
            toolName:
              type: string
              minLength: 1
              maxLength: 100
              description: Tool name (for SINGLE execution)
            parameters:
              type: object
              description: Tool parameters (for SINGLE execution)
            tools:
              type: array
              maxItems: 20
              description: Array of tools to execute (for BATCH execution)
              items:
                type: object
                required:
                  - name
                  - parameters
                properties:
                  name:
                    type: string
                    minLength: 1
                    maxLength: 100
                    description: Tool name
                  parameters:
                    type: object
                    description: Tool parameters
            executedTools:
              type: array
              maxItems: 50
              description: Previously executed tools in context
              items:
                type: object
                properties:
                  name:
                    type: string
                  executionId:
                    type: string
        stream:
          type: boolean
          default: false
          description: >-
            Return the continuation as a text/event-stream instead of one JSON
            response
        memory:
          type: boolean
          description: >-
            Override whether the continuation may search the agent knowledge.
            Omitted, it inherits the setting of the turn being resumed.
        source_ids:
          type: array
          items:
            type: string
          description: >-
            Override the knowledge search scope for this step. Omitted, it
            inherits the turn scope; send [] to clear it.
        tags:
          type: array
          items:
            type: string
          description: >-
            Override the tag scope for this step. Omitted, it inherits the turn
            tags; send [] to clear it.
    ExecuteToolResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Execution success status
        result:
          type: object
          description: Tool execution result
        executionId:
          type: string
          description: Execution ID
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Enter your API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.