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

# Consultar uso de herramienta

> Lista los agentes que tienen asignada una herramienta.

Consulta qué agentes tienen asignada una herramienta antes de eliminarla.

## Endpoint

```text theme={null}
GET /tools/{toolId}/usage
```

## Ejemplo de solicitud

```bash theme={null}
curl "https://api.insuranceboosters.com/api/v1/tools/<tool-id>/usage" \
  -H "x-ib-api-key: TU_API_KEY"
```

## Respuesta exitosa (`200`)

`agents` contiene únicamente `id` y `name`. Si ningún agente usa la
herramienta, devuelve `{"agents":[]}`.

```json theme={null}
{
  "agents": [
    {
      "id": "<agentId>",
      "name": "Asistente de atención"
    }
  ]
}
```

## Errores frecuentes

| HTTP | Qué significa | Qué hacer |
| - | - | - |
| `401` | API key inválida o faltante. | Verifica `x-ib-api-key`. |
| `404` | No se encontró la herramienta. | Confirma `toolId`. |
| `500` | No fue posible consultar el uso. | Reintenta; si continúa, contacta soporte. |


## OpenAPI

````yaml openapi/herramientas-agentes-v1.yaml GET /tools/{toolId}/usage
openapi: 3.1.0
info:
  title: Insurance Boosters API — Herramientas de agentes IA
  version: 1.0.0
  description: >-
    API pública para administrar y probar las herramientas que pueden usar tus
    agentes de IA.
  license:
    name: Propietaria
    url: https://insuranceboosters.com
servers:
  - url: https://api.insuranceboosters.com/api/v1
    description: Producción
security:
  - IbApiKey: []
tags:
  - name: Herramientas de agentes
    description: Administración de herramientas para agentes de IA.
paths:
  /tools/{toolId}/usage:
    get:
      tags:
        - Herramientas de agentes
      summary: Consultar uso de herramienta
      description: Lista los agentes que tienen asignada la herramienta.
      operationId: getAgentToolUsage
      parameters:
        - $ref: '#/components/parameters/ToolId'
      responses:
        '200':
          description: >-
            Agentes que usan la herramienta. `agents` puede ser un arreglo
            vacío.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolUsageResponse'
              example:
                agents:
                  - id: <agentId>
                    name: Asistente de atención
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/ToolNotFound'
        '500':
          $ref: '#/components/responses/UnexpectedError'
components:
  parameters:
    ToolId:
      name: toolId
      in: path
      required: true
      description: Identificador de la herramienta.
      schema:
        type: string
      example: tool_01
  schemas:
    ToolUsageResponse:
      type: object
      required:
        - agents
      properties:
        agents:
          type: array
          items:
            type: object
            required:
              - id
              - name
            properties:
              id:
                type: string
              name:
                type: string
    Error:
      type: object
      properties:
        success:
          type: boolean
          description: Vale `false` cuando la operación no se completa.
        error:
          description: Detalle del error.
        message:
          type: string
          description: Mensaje del error.
        code:
          type: string
          description: Código del error, cuando está disponible.
  responses:
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidApiKey:
              value:
                message: Invalid API key.
            missingAuth:
              value:
                message: Invalid authorization format.
    ToolNotFound:
      description: No se encontró la herramienta.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnexpectedError:
      description: Error inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IbApiKey:
      type: apiKey
      in: header
      name: x-ib-api-key

````

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