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

# Create a new tool server

> Creates a new tool server. If toolDefinitions array is provided, a new tool server definition will be created and linked automatically.



## OpenAPI

````yaml POST /v1/tool-servers
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
paths:
  /v1/tool-servers:
    post:
      tags:
        - Tool Servers
      summary: Create a new tool server
      description: >-
        Creates a new tool server. If toolDefinitions array is provided, a new
        tool server definition will be created and linked automatically.
      operationId: createToolServer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateToolServerRequest'
      responses:
        '201':
          description: Tool server created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolServerWithDefinitionResponse'
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - Invalid or missing token
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    CreateToolServerRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Tool server name
        description:
          type: string
          description: Tool server description
        url:
          type: string
          description: Base URL for the tool server API
        identifier:
          type: string
          description: Tool server identifier (URL-friendly)
        enabled:
          type: boolean
          default: true
          description: Whether the tool server is enabled
        mcpType:
          type: boolean
          description: Whether this is an MCP type server
        mcpServerProperties:
          $ref: '#/components/schemas/McpServerProperties'
        authenticationConfig:
          $ref: '#/components/schemas/AuthenticationConfig'
        imageUrl:
          type: string
          description: Image URL for the tool server
        toolServerDefinitionId:
          type: string
          description: Tool server definition ID to link to an existing definition
        toolDefinitions:
          type: array
          items:
            $ref: '#/components/schemas/ToolDefinition'
          description: Array of tool definitions
    ToolServerWithDefinitionResponse:
      allOf:
        - $ref: '#/components/schemas/ToolServerResponse'
        - type: object
          properties:
            toolServerDefinition:
              $ref: '#/components/schemas/ToolServerDefinitionResponse'
    McpServerProperties:
      type: object
      properties:
        mode:
          type: string
          enum:
            - public
            - private
          description: Server mode
        slug:
          type: string
          description: Server slug (URL-friendly identifier)
        status:
          type: string
          enum:
            - active
            - inactive
          description: Server status
    AuthenticationConfig:
      type: object
      properties:
        authenticationMethod:
          type: string
          enum:
            - jwt
            - basic
            - oauth2
            - customHeader
          description: Authentication method
        jwt:
          type: object
          properties:
            token:
              type: string
        basic:
          type: object
          properties:
            username:
              type: string
            password:
              type: string
        oauth2:
          type: object
          properties:
            refreshToken:
              type: string
            clientId:
              type: string
            clientSecret:
              type: string
            refreshTokenEndpoint:
              type: string
            grant_type:
              type: string
              enum:
                - refresh_token
                - client_credentials
            scope:
              type: string
            requestFormat:
              type: string
              enum:
                - json
                - form
        customHeader:
          oneOf:
            - $ref: '#/components/schemas/ToolHeader'
            - type: array
              items:
                $ref: '#/components/schemas/ToolHeader'
    ToolDefinition:
      type: object
      required:
        - function
      properties:
        type:
          type: string
          enum:
            - function
          description: Tool type (always 'function')
        function:
          $ref: '#/components/schemas/ToolFunction'
        endpoint:
          type: string
          description: API endpoint for the tool
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
          description: HTTP method
        queryParametersKeys:
          type: array
          items:
            type: string
          description: Query parameter keys
        pathParametersKeys:
          type: array
          items:
            type: string
          description: Path parameter keys
        bodyPropertyKey:
          type: string
          description: Body property key for request body
        customHeaders:
          type: array
          items:
            $ref: '#/components/schemas/ToolHeader'
          description: Custom headers for the tool
        isFormDataBody:
          type: boolean
          description: Whether the body is form data
        bodyMode:
          type: string
          enum:
            - simple
            - advanced
          description: Body mode
        bodyJsonTemplate:
          type: string
          description: JSON body template for advanced mode
        responsePostProcessingEnabled:
          type: boolean
          description: Whether response post-processing is enabled
        responsePostProcessingTemplate:
          type: string
          description: JS expression template for response post-processing
    ToolServerResponse:
      type: object
      properties:
        _id:
          type: string
          description: Tool server ID
        clientUID:
          type: string
          description: Client UID
        enabled:
          type: boolean
          description: Whether the tool server is enabled
        url:
          type: string
          description: Base URL
        identifier:
          type: string
          description: Tool server identifier
        name:
          type: string
          description: Tool server name
        description:
          type: string
          description: Tool server description
        mcpType:
          type: boolean
          description: Whether this is an MCP type server
        mcpServerProperties:
          $ref: '#/components/schemas/McpServerProperties'
        toolServerDefinitionId:
          type: string
          description: Tool server definition ID
        imageUrl:
          type: string
          description: Image URL
        creartionTimestampMs:
          type: integer
          description: Creation timestamp in milliseconds
        lastEditTimestampMS:
          type: integer
          description: Last edit timestamp in milliseconds
    ToolServerDefinitionResponse:
      type: object
      properties:
        _id:
          type: string
          description: Definition ID
        name:
          type: string
          description: Definition name
        description:
          type: string
          description: Definition description
        toolDefinitions:
          type: array
          items:
            $ref: '#/components/schemas/ToolDefinition'
          description: Array of tool definitions
    ToolHeader:
      type: object
      properties:
        headerName:
          type: string
          description: Header name
        value:
          type: string
          description: Header value
    ToolFunction:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Tool function name (snake_case recommended)
        description:
          type: string
          description: Tool function description
        strict:
          type: boolean
          description: Whether the tool uses strict mode
        parameters:
          $ref: '#/components/schemas/ToolFunctionParameters'
    ToolFunctionParameters:
      type: object
      properties:
        type:
          type: string
          description: Parameter type (usually 'object')
        properties:
          type: object
          additionalProperties:
            type: object
            properties:
              type:
                type: string
              description:
                type: string
          description: Parameter properties definition
        required:
          type: array
          items:
            type: string
          description: Required parameter names
        additionalProperties:
          type: boolean
          description: Whether additional properties are allowed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use JWT token for authentication

````