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

# Create a tool

> Creates a tool in a project. You can't create an MCP tool with this request. Import it from an MCP server instead.



## OpenAPI

````yaml https://api-trial.cognigy.ai/swagger/openapi.json post /tools
openapi: 3.0.3
info:
  contact:
    email: support@example.com
    name: API Support
  description: API for managing agents and related resources
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Agents API
  version: '1.0'
servers:
  - url: https://api-trial.cognigy.ai/v1
security:
  - ApiKey: []
tags:
  - name: Agents
  - name: Brand personas
  - name: Tools
  - name: Built-in tools
  - name: Skills
  - name: Built-in skills
  - name: MCP servers
  - description: >-
      Remote agents that speak the A2A (Agent2Agent) protocol. Available only
      while FEATURE_ENABLE_A2A_TOOLS is on; every route answers 404 otherwise.
    name: A2A agents
  - name: Tool references
paths:
  /tools:
    post:
      tags:
        - Tools
      summary: Create a tool
      description: >-
        Creates a tool in a project. You can't create an MCP tool with this
        request. Import it from an MCP server instead.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_tools.CreateToolRequest'
        description: The tool to create.
        required: true
        x-originalParamName: tool
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_tools.CreateToolResponse'
          description: Returns the created tool.
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest
          description: >-
            Invalid request body or validation error; code `reserved_tool_name`
            when the name is one the platform reserves for its own actions.
        '403':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden
          description: Access denied.
        '409':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict
          description: >-
            Another tool in this project has a name the agent sees as the same
            (ignoring case and characters it replaces with underscores).
        '500':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError
          description: Internal server error.
components:
  schemas:
    internal_tools.CreateToolRequest:
      properties:
        builtinSlug:
          description: >-
            The slug of the built-in tool to create the tool from. It's required
            when

            `source` is `builtin`.
          example: my-tool-slug
          type: string
        description:
          description: A description of the tool.
          example: A tool that performs an action
          type: string
        extension:
          description: |-
            The name of the extension that provides the tool. It's required when
            `source` is `extension`.
          example: my-extension
          type: string
        name:
          description: >-
            The name of the tool. The name must be 1 to 200 bytes long and can't

            contain the characters `\`, `/`, `:`, `*`, `?`, `"`, `<`, `>`, `|`
            or `¥`.

            Leading and trailing spaces are trimmed. The name must be unique in
            the

            project, ignoring case.
          example: My Tool
          type: string
        parameters:
          description: >-
            The parameters of the tool. Each parameter `key` must be unique
            within the

            tool.
          items:
            $ref: '#/components/schemas/internal_tools.ToolParameterRequest'
          type: array
        projectId:
          description: The unique identifier for the project to create the tool in.
          example: 507f1f77bcf86cd799439011
          type: string
        source:
          description: >-
            The origin of the tool. The allowed values are `extension`,
            `managed` and

            `builtin`. The default is `extension`.
          example: extension
          type: string
        type:
          description: The technical identifier of the tool type.
          example: action
          type: string
      required:
        - parameters
        - projectId
        - type
      type: object
    internal_tools.CreateToolResponse:
      properties:
        a2a:
          allOf:
            - $ref: '#/components/schemas/internal_tools.A2ABindingResponse'
          description: |-
            The remote A2A agent that this tool calls. It's present only when
            `source` is `a2a`.
        builtinSlug:
          description: >-
            The slug of the built-in tool that this tool is created from. It's
            present

            only for built-in tools.
          example: my-tool-slug
          type: string
        createdAt:
          description: The time when the tool was created, as a Unix timestamp in seconds.
          example: 1694518620
          type: integer
        createdBy:
          description: The unique identifier for the user who created the tool.
          example: 507f1f77bcf86cd799439011
          type: string
        description:
          description: A description of the tool.
          example: A tool that performs an action
          type: string
        extension:
          description: The name of the extension that provides the tool.
          example: my-extension
          type: string
        id:
          description: The unique identifier for the tool.
          example: 507f1f77bcf86cd799439011
          type: string
        lastChangedAt:
          description: >-
            The time when the tool was last changed, as a Unix timestamp in
            seconds.
          example: 1694518620
          type: integer
        lastChangedBy:
          description: The unique identifier for the user who last changed the tool.
          example: 507f1f77bcf86cd799439011
          type: string
        mcp:
          allOf:
            - $ref: '#/components/schemas/internal_tools.MCPBindingResponse'
          description: >-
            The MCP server and the remote tool that this tool is imported from,

            including the input schema of the remote tool. It's present only
            when

            `source` is `mcp`.
        name:
          description: The name of the tool.
          example: My Tool
          type: string
        organisationId:
          description: The unique identifier for the organization that the tool belongs to.
          example: 507f1f77bcf86cd799439011
          type: string
        parameters:
          description: >-
            The parameters of the tool. An MCP tool has none, because its input
            schema

            is in `mcp.inputSchema`.
          items:
            $ref: '#/components/schemas/internal_tools.ToolParameterResponse'
          type: array
        projectId:
          description: The unique identifier for the project that the tool belongs to.
          example: 507f1f77bcf86cd799439011
          type: string
        referenceId:
          description: |-
            The UUID that agents and skills use to reference the tool. The API
            generates it when the tool is created.
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        source:
          description: >-
            The origin of the tool. The possible values are `extension`,
            `managed`,

            `builtin`, `mcp` and `a2a`.
          example: extension
          type: string
        type:
          description: The technical identifier of the tool type.
          example: action
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest:
      properties:
        code:
          description: |-
            Code is a stable machine-readable reason, present on some 400s only
            (for example "reserved_tool_name").
          example: reserved_tool_name
          type: string
        detail:
          example: request body validation failed
          type: string
        errors:
          items:
            $ref: >-
              #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.FieldError
          type: array
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 400
          type: integer
        title:
          example: Bad Request
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden:
      properties:
        detail:
          example: 'access denied: insufficient permissions'
          type: string
        instance:
          example: /v1/{resource}/{id}
          type: string
        status:
          example: 403
          type: integer
        title:
          example: Forbidden
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict:
      properties:
        detail:
          example: a resource with this identifier already exists
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 409
          type: integer
        title:
          example: Conflict
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError:
      properties:
        detail:
          example: internal server error
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 500
          type: integer
        title:
          example: Internal Server Error
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    internal_tools.ToolParameterRequest:
      properties:
        connectionTypes:
          description: >-
            The connection types that the parameter accepts, as connection
            schema type

            slugs. You can set it only when `type` is `connection`. If you omit
            it or

            send an empty list, the parameter accepts any connection type.
          example:
            - http_basic
            - http_oauth2
          items:
            type: string
          type: array
        description:
          description: A description of the parameter.
          example: The input parameter
          type: string
        key:
          description: The key of the parameter. The key must be unique within the tool.
          example: input
          type: string
        mode:
          description: >-
            How the parameter gets its value. The allowed values are `dynamic`
            and

            `aiFilled`. A `dynamic` parameter uses the fixed value that you set
            in

            `value`. The LLM fills an `aiFilled` parameter at runtime. A
            `connection`

            parameter must use `dynamic`.
          example: dynamic
          type: string
        name:
          description: The name of the parameter.
          example: input
          type: string
        type:
          description: >-
            The data type of the parameter. The allowed values are `string`,
            `number`,

            `boolean`, `object`, `array` and `connection`.
          example: string
          type: string
        value:
          description: >-
            The value of the parameter. It's required when `mode` is `dynamic`,
            and it

            must match `type`. For a `connection` parameter, it's the
            `referenceId` of

            the connection, as a UUID.

            An empty string means that no connection is bound.
      required:
        - key
        - mode
        - name
        - type
      type: object
    internal_tools.A2ABindingResponse:
      properties:
        agentReferenceId:
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
      type: object
    internal_tools.MCPBindingResponse:
      properties:
        inputSchema:
          additionalProperties: {}
          description: >-
            The JSON Schema for the input of the remote tool, as the remote MCP
            server

            reports it. The schema contains no references, but it can contain
            `oneOf`,

            `allOf`, `anyOf` and `not`. The order of the properties isn't
            preserved.
          type: object
        serverReferenceId:
          description: The `referenceId` of the MCP server that the tool is imported from.
          example: 550e8400-e29b-41d4-a716-446655440000
          type: string
        toolName:
          description: The name of the tool on the remote MCP server.
          example: search_issues
          type: string
      type: object
    internal_tools.ToolParameterResponse:
      properties:
        connectionTypes:
          description: >-
            The connection types that the parameter accepts, as connection
            schema type

            slugs. It's set only on `connection` parameters. If it's absent or
            empty,

            the parameter accepts any connection type.
          example:
            - http_basic
            - http_oauth2
          items:
            type: string
          type: array
        description:
          description: A description of the parameter.
          example: The input parameter
          type: string
        key:
          description: The key of the parameter. The key must be unique within the tool.
          example: input
          type: string
        mode:
          description: >-
            How the parameter gets its value. The allowed values are `dynamic`
            and

            `aiFilled`. A `dynamic` parameter uses the fixed value that you set
            in

            `value`. The LLM fills an `aiFilled` parameter at runtime. A
            `connection`

            parameter must use `dynamic`.
          example: dynamic
          type: string
        name:
          description: The name of the parameter.
          example: input
          type: string
        type:
          description: >-
            The data type of the parameter. The allowed values are `string`,
            `number`,

            `boolean`, `object`, `array` and `connection`.
          example: string
          type: string
        value:
          description: |-
            The value of the parameter. For a `connection` parameter, it's the
            `referenceId` of the connection, as a UUID.
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.FieldError:
      properties:
        field:
          type: string
        message:
          type: string
      type: object
  securitySchemes:
    ApiKey:
      description: '[Production] API key for production authentication'
      in: header
      name: X-API-Key
      type: apiKey

````