openapi: 3.1.0
info:
  title: Evolution Foundation - AI Processor Service - Tools
  description: AI processing, integrations and sessions
  version: 1.0.0
servers:
- url: https://api.evoai.app
  description: Production server
- url: http://localhost:3004
  description: Development server
  variables:
    port:
      default: '3004'
- url: '{customUrl}'
  description: Custom server
  variables:
    customUrl:
      default: https://your-instance.com
      description: Enter your server URL
paths:
  /api/v1/tools:
    get:
      summary: List Available Tools
      description: List all available tools with optional filtering
      operationId: list_available_tools_api_v1_tools_get
      security:
      - ApiAccessToken: []
      parameters:
      - name: category
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by category ID
          title: Category
        description: Filter by category ID
      - name: tags
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by tags (comma-separated)
          title: Tags
        description: Filter by tags (comma-separated)
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Search in name and description
          title: Search
        description: Search in name and description
      responses:
        '200':
          description: Tools retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_AvailableToolsResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools
                  method: GET
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools
                  method: GET
  /api/v1/tools/categories/list:
    get:
      summary: List Tool Categories
      description: List all tool categories
      operationId: list_tool_categories_api_v1_tools_categories_list_get
      responses:
        '200':
          description: Tool categories retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_List_ToolCategory__'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/categories/list
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/categories/list
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/categories/list
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/categories/list
                  method: GET
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/categories/list
                  method: GET
      security:
      - ApiAccessToken: []
  /api/v1/tools/reload-config:
    post:
      summary: Reload Tools Config
      description: Reload tools configuration from file (admin only)
      operationId: reload_tools_config_api_v1_tools_reload_config_post
      responses:
        '200':
          description: Tools configuration reloaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_NoneType_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/reload-config
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/reload-config
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/reload-config
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Configuration file not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/reload-config
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/reload-config
                  method: POST
      security:
      - ApiAccessToken: []
  /api/v1/tools/{tool_id}:
    get:
      summary: Get Tool Details
      description: Get details of a specific tool
      operationId: get_tool_details_api_v1_tools__tool_id__get
      security:
      - ApiAccessToken: []
      parameters:
      - name: tool_id
        in: path
        required: true
        schema:
          type: string
          title: Tool Id
      responses:
        '200':
          description: Tool retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_AvailableTool_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request parameters
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/{tool_id}
                  method: GET
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/{tool_id}
                  method: GET
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/{tool_id}
                  method: GET
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Tool not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/{tool_id}
                  method: GET
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/tools/{tool_id}
                  method: GET
components:
  schemas:
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: false
        error:
          $ref: '#/components/schemas/ErrorInfo'
        meta:
          $ref: '#/components/schemas/MetaInfoError'
          description: Metadata
      type: object
      required:
      - error
      - meta
      title: ErrorResponse
      description: 'Standard error response schema matching error_response() return format.


        This schema matches the structure returned by error_response() function,

        which always uses ErrorInfo for the error field.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SuccessResponse_AvailableTool_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/AvailableTool'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[AvailableTool]
    SuccessResponse_AvailableToolsResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: '#/components/schemas/AvailableToolsResponse'
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[AvailableToolsResponse]
    SuccessResponse_List_ToolCategory__:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          items:
            $ref: '#/components/schemas/ToolCategory'
          type: array
          title: Data
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[List[ToolCategory]]
    SuccessResponse_NoneType_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          type: 'null'
          title: Data
          description: Response payload
        meta:
          $ref: '#/components/schemas/MetaInfo'
          description: Metadata
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
      - data
      - meta
      title: SuccessResponse[NoneType]
  securitySchemes:
    ApiAccessToken:
      type: apiKey
      in: header
      name: api_access_token
      description: API Access Token (UUID) for authentication
