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

# Create HTTP tool

> Create a new custom HTTP tool for an HTTP integration. Only works with HTTP integrations. MCP tools are synced automatically from the MCP server.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/integration/{integration_id}/tool
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/integration/{integration_id}/tool:
    post:
      tags:
        - Integration
      summary: Create HTTP tool
      description: >-
        Create a new custom HTTP tool for an HTTP integration. Only works with
        HTTP integrations. MCP tools are synced automatically from the MCP
        server.
      operationId: create_integration_tool_v1_integration__integration_id__tool_post
      parameters:
        - name: integration_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Integration ID
            title: Integration Id
          description: Integration ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHttpToolRequestSchema'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/HttpToolResponseSchema'
                  - $ref: '#/components/schemas/McpToolSchema'
                discriminator:
                  propertyName: type
                  mapping:
                    HTTP:
                      $ref: '#/components/schemas/HttpToolResponseSchema'
                    MCP:
                      $ref: '#/components/schemas/McpToolSchema'
                title: >-
                  Response Create Integration Tool V1 Integration  Integration
                  Id  Tool Post
        '400':
          description: Bad request - Wrong integration type
          content:
            application/json:
              example:
                status: error
                error_code: INTEGRATION_TYPE
                message: >-
                  Cannot create tools for MCP integration
                  550e8400-e29b-41d4-a716-446655440000
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: Missing required permissions to create integration tools
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '404':
          description: Integration Not Found
          content:
            application/json:
              example:
                status: error
                error_code: INTEGRATION_NOT_FOUND
                message: Integration 550e8400-e29b-41d4-a716-446655440000 not found
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '409':
          description: Conflict - Duplicate tool name or parameter
          content:
            application/json:
              example:
                status: error
                error_code: DUPLICATE_FIELD
                message: Tool with name 'my-tool' already exists in this integration
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              example:
                status: error
                error_code: INTERNAL_SERVER_ERROR
                message: 'Error: Internal Server Error'
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    CreateHttpToolRequestSchema:
      properties:
        name:
          type: string
          title: Tool Name
          description: The name of the tool
        description:
          type: string
          title: Description
          description: The description given to the agent to understand the tool
        endpoint_path:
          type: string
          title: Endpoint URL
          description: The URL to the endpoint of the tool
        query:
          anyOf:
            - items:
                $ref: '#/components/schemas/QueryParamSchema'
              type: array
            - type: 'null'
          title: Query Parameters
          description: The query parameters for the tool
          default: []
        body:
          anyOf:
            - items:
                $ref: '#/components/schemas/BodyParamSchema-Input'
              type: array
            - type: 'null'
          title: Body Parameters
          description: The body parameters for the tool
          default: []
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
          description: The headers for the tool
        method:
          $ref: '#/components/schemas/HttpMethods'
          title: Method
          description: The HTTP method for the tool
        timeout:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout
          description: Timeout for the API to send a response
          default: 5
        approval_required:
          type: boolean
          title: Approval Required
          description: If true, the agent will ask for confirmation before executing
          default: false
        execution_audio:
          anyOf:
            - $ref: '#/components/schemas/ExecutionAudio'
            - type: 'null'
          title: Execution Audio
          description: Background sound to play while the tool is executing
        pre_speech:
          type: string
          enum:
            - auto
            - force
          title: Pre-Speech
          description: 'Whether agent should speak before executing: ''auto'' or ''force'''
          default: auto
      type: object
      required:
        - name
        - description
        - endpoint_path
        - method
      title: CreateHttpToolRequestSchema
    HttpToolResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Tool Id
          description: The unique identifier for the tool
        type:
          type: string
          const: HTTP
          title: Type
          default: HTTP
        name:
          type: string
          title: Tool Name
          description: The name of the tool
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description given to the agent to understand the tool
        endpoint_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Endpoint URL
          description: The URL to the endpoint of the tool
        query:
          anyOf:
            - items:
                $ref: '#/components/schemas/QueryParamSchema'
              type: array
            - type: 'null'
          title: Query Parameters
          description: The query parameters for the tool
          default: []
        body:
          anyOf:
            - items:
                $ref: '#/components/schemas/BodyParamSchema-Output'
              type: array
            - type: 'null'
          title: Body Parameters
          description: The body parameters for the tool
          default: []
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
          description: The headers for the tool
        method:
          $ref: '#/components/schemas/HttpMethods'
          title: Method
          description: The HTTP method for the tool
        timeout:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout
          description: Timeout for the API to send a response
          default: 5
        approval_required:
          type: boolean
          title: Approval Required
          description: If true, the agent will ask for confirmation before executing
          default: false
        execution_audio:
          anyOf:
            - $ref: '#/components/schemas/ExecutionAudio'
            - type: 'null'
          title: Execution Sound
          description: Background sound to play while the tool is executing
        pre_speech:
          type: string
          enum:
            - auto
            - force
          title: Pre-Speech
          description: 'Whether agent should speak before executing: ''auto'' or ''force'''
          default: auto
      type: object
      required:
        - id
        - name
        - headers
        - method
      title: HttpToolResponseSchema
    McpToolSchema:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Tool Id
          description: The unique identifier for the tool in the database
        type:
          type: string
          const: MCP
          title: Type
          default: MCP
        name:
          type: string
          title: Tool Name
          description: The name of the tool
        description:
          type: string
          title: Description
          description: The description given to the agent to understand the tool
        parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Schema
          description: JSON schema for the tool parameters
        approval_required:
          type: boolean
          title: Approval Required
          description: If true, the agent will ask for confirmation before executing
          default: false
      type: object
      required:
        - name
        - description
      title: McpToolSchema
    ErrorResponseSchema:
      properties:
        status:
          type: string
          title: Status
          description: Status of the response, always 'error' for error responses
          default: error
        error_code:
          type: string
          title: Error Code
          description: Machine-readable error code in SCREAMING_SNAKE_CASE format
          examples:
            - PROJECT_NOT_FOUND
            - INVALID_EMAIL
            - UNAUTHORIZED_ROLE
        message:
          type: string
          title: Message
          description: Human-readable error message with details
          examples:
            - Project with id 550e8400-e29b-41d4-a716-446655440000 not found
            - The email invalid@email is not valid
            - Insufficient permissions to perform this action
      type: object
      required:
        - error_code
        - message
      title: ErrorResponseSchema
      description: Standard error response format for all API errors.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    QueryParamSchema:
      properties:
        name:
          type: string
          title: Parameter Name
          description: Parameter name without spaces
        data_type:
          $ref: '#/components/schemas/SimpleDataTypes'
          title: Type
          description: Data type of the parameter
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of what the parameter does
        required:
          type: boolean
          title: Required
          description: Indicates if the parameter is required.
          default: true
        value_source:
          $ref: '#/components/schemas/ParamValueSource'
          title: Value Source
          description: Source of the parameter value (llm or fixed)
          default: llm
        fixed_value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - type: 'null'
          title: Fixed Value
          description: Fixed value for the parameter when value_source is FIXED
      type: object
      required:
        - name
        - data_type
      title: QueryParamSchema
      description: Schema for defining parameters with specific validations.
    BodyParamSchema-Input:
      properties:
        name:
          type: string
          title: Parameter Name
          description: Parameter name without spaces
        data_type:
          $ref: '#/components/schemas/DataTypes'
          title: Type
          description: Data type of the parameter
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of what the parameter does
        required:
          type: boolean
          title: Required
          description: Indicates if the parameter is required.
          default: true
        value_source:
          $ref: '#/components/schemas/ParamValueSource'
          title: Value Source
          description: Source of the parameter value (llm or fixed)
          default: llm
        fixed_value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - type: 'null'
          title: Fixed Value
          description: Fixed value for the parameter when value_source is FIXED
        properties:
          anyOf:
            - items:
                $ref: '#/components/schemas/BodyParamSchema-Input'
              type: array
            - type: 'null'
          title: Nested Properties
          description: Nested parameters for object/complex types
      type: object
      required:
        - name
        - data_type
      title: BodyParamSchema
      description: Schema for defining parameters with specific validations.
    HttpMethods:
      type: string
      enum:
        - GET
        - POST
        - PUT
        - DELETE
        - PATCH
      title: HttpMethods
    ExecutionAudio:
      type: string
      enum:
        - waiting_music
        - typing
      title: ExecutionAudio
    BodyParamSchema-Output:
      properties:
        name:
          type: string
          title: Parameter Name
          description: Parameter name without spaces
        data_type:
          $ref: '#/components/schemas/DataTypes'
          title: Type
          description: Data type of the parameter
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of what the parameter does
        required:
          type: boolean
          title: Required
          description: Indicates if the parameter is required.
          default: true
        value_source:
          $ref: '#/components/schemas/ParamValueSource'
          title: Value Source
          description: Source of the parameter value (llm or fixed)
          default: llm
        fixed_value:
          anyOf:
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - type: 'null'
          title: Fixed Value
          description: Fixed value for the parameter when value_source is FIXED
        properties:
          anyOf:
            - items:
                $ref: '#/components/schemas/BodyParamSchema-Output'
              type: array
            - type: 'null'
          title: Nested Properties
          description: Nested parameters for object/complex types
      type: object
      required:
        - name
        - data_type
      title: BodyParamSchema
      description: Schema for defining parameters with specific validations.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SimpleDataTypes:
      type: string
      enum:
        - string
        - integer
        - number
        - boolean
      title: SimpleDataTypes
    ParamValueSource:
      type: string
      enum:
        - llm
        - fixed
        - dynamic
      title: ParamValueSource
    DataTypes:
      type: string
      enum:
        - string
        - integer
        - number
        - boolean
        - object
      title: DataTypes
  securitySchemes:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````