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

# Execute agent-tool-selection-quality evaluator

> Evaluate whether the agent selected the most appropriate tool(s) for the task at hand

**Request Body:**
- `input.input_messages` (array of objects, required): The agent's input messages — system prompt + conversation history as a JSON array of message objects (`role`, `content`, optional `tool_calls`, etc.)
- `input.output_messages` (array of objects, required): The agent's output messages for this step as a JSON array of message objects (may contain tool calls or plain text)



## OpenAPI

````yaml post /v2/evaluators/agent-tool-selection-quality/execute
openapi: 3.0.0
info:
  title: Traceloop API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.traceloop.com
security: []
paths:
  /v2/evaluators/agent-tool-selection-quality/execute:
    post:
      tags:
        - evaluators
      summary: Execute agent-tool-selection-quality evaluator
      description: >-
        Evaluate whether the agent selected the most appropriate tool(s) for the
        task at hand


        **Request Body:**

        - `input.input_messages` (array of objects, required): The agent's input
        messages — system prompt + conversation history as a JSON array of
        message objects (`role`, `content`, optional `tool_calls`, etc.)

        - `input.output_messages` (array of objects, required): The agent's
        output messages for this step as a JSON array of message objects (may
        contain tool calls or plain text)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/request.AgentToolSelectionQualityRequest'
        description: Request body
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/response.AgentToolSelectionQualityResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    request.AgentToolSelectionQualityRequest:
      properties:
        input:
          $ref: '#/components/schemas/request.AgentToolSelectionQualityInput'
      required:
        - input
      type: object
    response.AgentToolSelectionQualityResponse:
      properties:
        correct_args:
          example: true
          type: boolean
        correct_args_reason:
          example: The city argument matches the user's request
          type: string
        tool_selection:
          example: correct
          type: string
        tool_selection_reason:
          example: The agent correctly chose get_weather for the weather query
          type: string
      type: object
    response.ErrorResponse:
      description: Standard error response structure
      properties:
        error:
          example: error message
          type: string
      type: object
    request.AgentToolSelectionQualityInput:
      properties:
        input_messages:
          example: >-
            [{"role":"system","content":"You are a helpful assistant with access
            to tools: 1. get_weather(city) - Get current weather. 2.
            search_web(query) - Search the web."},{"role":"user","content":"What
            is the weather like in Paris?"}]
          type: string
        output_messages:
          example: >-
            [{"role":"assistant","tool_calls":[{"name":"get_weather","arguments":{"city":"Paris"}}]}]
          type: string
      required:
        - input_messages
        - output_messages
      type: object
  securitySchemes:
    BearerAuth:
      description: Type "Bearer" followed by a space and JWT token.
      in: header
      name: Authorization
      type: apiKey

````