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

# Optimize Tool

> Optimize a tool's performance and configuration based on usage patterns and feedback.



## OpenAPI

````yaml post /tool/optimize/{toolFunctionName}
openapi: 3.0.0
info:
  title: Public API
  description: Public endpoints to interact with agents and orchestrate tasks
  version: '1.0'
  contact: {}
servers:
  - url: https://api.beamstudio.ai
security: []
tags: []
paths:
  /tool/optimize/{toolFunctionName}:
    post:
      tags:
        - Tool
      summary: Optimize Tool
      description: >-
        Optimize a tool's performance and configuration based on usage patterns
        and feedback.
      operationId: ToolController_optimizeTool
      parameters:
        - name: toolFunctionName
          required: true
          in: path
          schema:
            type: string
        - name: current-workspace-id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolOptimizeRequestDTO'
      responses:
        '201':
          description: Tool optimization initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolOptimizeResponseDTO'
      security:
        - x-api-key: []
components:
  schemas:
    ToolOptimizeRequestDTO:
      type: object
      properties:
        taskNodes:
          type: array
          items:
            $ref: '#/components/schemas/ToolOptimizeTaskNodesDTO'
        agentId:
          type: string
        autoUpdateTool:
          type: boolean
      required:
        - agentId
    ToolOptimizeResponseDTO:
      type: object
      properties:
        threadId:
          type: string
      required:
        - threadId
    ToolOptimizeTaskNodesDTO:
      type: object
      properties:
        feedback:
          type: string
        positive:
          type: boolean
        expectedOutput:
          type: string
        id:
          type: string
      required:
        - positive
        - id
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````