# Tool

Manage Tools

## Listing tools

> Retrieves tools based on the provided query.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"NativeToolsResponse":{"type":"array","description":"List of native tools which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolResponse"},{"$ref":"#/components/schemas/RagCustomNativeToolResponse"},{"$ref":"#/components/schemas/RagEmporixNativeToolResponse"}]}},"SlackNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataResponse":{"allOf":[{"$ref":"#/components/schemas/MetadataRequest"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}},"required":["version","createdAt","modifiedAt"]}]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigResponse"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigResponse"}}}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"ExpandableTokenResponse":{"oneOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"$ref":"#/components/schemas/ExpandedTokenResponse"}],"description":"The full response representing token. If the `expand=token` is **not** used, then only `id` field is returned, otherwise all fields are returned."},"InnerTokenResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}}},"ExpandedTokenResponse":{"allOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"type":"object","properties":{"name":{"type":"string","description":"Name of the token."},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagEmporixNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigResponse"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse"}]}}}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools":{"get":{"summary":"Listing tools","operationId":"GET-ai-list-tools","responses":{"200":{"description":"List of tools.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NativeToolsResponse"}}}}},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"}},"description":"Retrieves tools based on the provided query.","tags":["Tool"]}}}}
```

## Searching tools

> Searches for tools based on the provided query.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"parameters":{"pageSize":{"schema":{"type":"string"},"in":"query","name":"pageSize","description":"The number of documents to be retrieved per page."},"pageNumber":{"schema":{"type":"string"},"in":"query","name":"pageNumber","description":"The page number to be retrieved. The size of the pages should be specified by the `pageSize` parameter."},"sort":{"schema":{"type":"string"},"in":"query","name":"sort","description":"List of properties used to sort the results, separated by colons."},"fields":{"schema":{"type":"string"},"in":"query","name":"fields","description":"Fields to be returned in the response."},"header_xTotalCount":{"schema":{"type":"boolean"},"in":"header","name":"X-Total-Count","description":"Flag indicating whether the total number of retrieved results should be returned."},"expandTool":{"schema":{"type":"string","enum":["token"]},"in":"query","name":"expand","description":"Fields to be expanded in the response. It means that instead of the object IDs, the whole objects are returned in the response."}},"schemas":{"NativeToolsResponse":{"type":"array","description":"List of native tools which agents should have access to.","items":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolResponse"},{"$ref":"#/components/schemas/RagCustomNativeToolResponse"},{"$ref":"#/components/schemas/RagEmporixNativeToolResponse"}]}},"SlackNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataResponse":{"allOf":[{"$ref":"#/components/schemas/MetadataRequest"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}},"required":["version","createdAt","modifiedAt"]}]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigResponse"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigResponse"}}}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"ExpandableTokenResponse":{"oneOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"$ref":"#/components/schemas/ExpandedTokenResponse"}],"description":"The full response representing token. If the `expand=token` is **not** used, then only `id` field is returned, otherwise all fields are returned."},"InnerTokenResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}}},"ExpandedTokenResponse":{"allOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"type":"object","properties":{"name":{"type":"string","description":"Name of the token."},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagEmporixNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigResponse"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse"}]}}}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"QParamSearchBody":{"type":"object","properties":{"q":{"type":"string","description":"A standard query parameter is used to search for specific values. \n\nSee: [Standard Practices - Query parameter](https://developer.emporix.io/api-references/standard-practices/q-param)\n"}}}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBodies":{"QParamSearchBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QParamSearchBody"}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools/search":{"post":{"parameters":[{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageNumber"},{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/header_xTotalCount"},{"$ref":"#/components/parameters/expandTool"}],"summary":"Searching tools","operationId":"POST-ai-search-tools","responses":{"200":{"description":"List of tools.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NativeToolsResponse"}}}}},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"}},"requestBody":{"$ref":"#/components/requestBodies/QParamSearchBody"},"description":"Searches for tools based on the provided query.","tags":["Tool"]}}}}
```

## Retrieving tool by ID

> Retrieves the tool by given ID.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_read"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"parameters":{"fields":{"schema":{"type":"string"},"in":"query","name":"fields","description":"Fields to be returned in the response."},"expandTool":{"schema":{"type":"string","enum":["token"]},"in":"query","name":"expand","description":"Fields to be expanded in the response. It means that instead of the object IDs, the whole objects are returned in the response."}},"schemas":{"SlackNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataResponse":{"allOf":[{"$ref":"#/components/schemas/MetadataRequest"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}},"required":["version","createdAt","modifiedAt"]}]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigResponse"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigResponse"}}}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"ExpandableTokenResponse":{"oneOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"$ref":"#/components/schemas/ExpandedTokenResponse"}],"description":"The full response representing token. If the `expand=token` is **not** used, then only `id` field is returned, otherwise all fields are returned."},"InnerTokenResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}}},"ExpandedTokenResponse":{"allOf":[{"$ref":"#/components/schemas/InnerTokenResponse"},{"type":"object","properties":{"name":{"type":"string","description":"Name of the token."},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagCustomEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolResponse":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the tool."},"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigResponse"},"metadata":{"$ref":"#/components/schemas/MetadataResponse"}}}]},"RagEmporixNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigResponse"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse"}]}}}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigResponse":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/ExpandableTokenResponse"}}}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""}},"responses":{"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_resp_common":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools/{toolId}":{"get":{"parameters":[{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expandTool"}],"summary":"Retrieving tool by ID","operationId":"GET-ai-retrieve-tool","responses":{"200":{"description":"A single tool.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolResponse"},{"$ref":"#/components/schemas/RagCustomNativeToolResponse"},{"$ref":"#/components/schemas/RagEmporixNativeToolResponse"}]}}}},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"404":{"$ref":"#/components/responses/404_resp_common"}},"description":"Retrieves the tool by given ID.","tags":["Tool"]}}}}
```

## Upserting tool

> Updates or creates a specified tool by replacing all of its existing data with data from the request body.\
> If the \`metadata.version\` is provided then optimistic locking is enabled and version must match the version in the database.\`

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"parameters":{"forceDisable":{"schema":{"type":"boolean"},"in":"query","name":"force","description":"Allows you to disable a given entity even if it is used as a dependency in other entries. In that case, cascade disable is performed."}},"schemas":{"IdResponse":{"type":"object","properties":{"id":{"type":"string","description":"Identifier of the resource."}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"SlackNativeToolRequest":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"type":{"description":"For SlackNativeTool it has to be set to `slack`."},"config":{"$ref":"#/components/schemas/SlackNativeToolConfigRequest"},"metadata":{"$ref":"#/components/schemas/MetadataRequest"}},"required":["config"]}]},"BaseNativeTool":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/NativeToolType"},"name":{"type":"string","description":"Name of the tool."},"enabled":{"type":"boolean","description":"An indicator whether the tool is enabled.","default":false}},"required":["type","name"]},"NativeToolType":{"type":"string","enum":["slack","rag_custom","rag_emporix"],"description":"Type of the native tool."},"SlackNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/SlackNativeToolConfigResponse"},{"type":"object","properties":{"botToken":{"type":"string","description":"OAuth token used to authenticate the Slack bot within the specified workspace. Required for performing authorized actions on behalf of the bot. Format usually starts with `xoxb-...`. It is required only for creation, for update operation it can be omitted."}},"required":["botToken"]}]},"SlackNativeToolConfigResponse":{"type":"object","properties":{"teamId":{"type":"string","description":"Unique identifier of the Slack workspace (team) associated with the request. Used to distinguish the source Slack environment when handling events or API calls."}},"required":["teamId"]},"MetadataRequest":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]},"RagCustomNativeToolRequest":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"type":{"description":"For `RagCustomNativeTool`, it has to be set to `rag_custom`."},"config":{"$ref":"#/components/schemas/RagCustomNativeToolConfigRequest"},"metadata":{"$ref":"#/components/schemas/MetadataRequest"}},"required":["config"]}]},"RagCustomNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/RagCustomNativeToolConfig"},{"type":"object","properties":{"databaseConfig":{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfigRequest"},"embeddingConfig":{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfigRequest"}},"required":["databaseConfig","embeddingConfig"]}]},"RagCustomNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"maxResults":{"type":"integer","default":5,"description":"The maximum number of results found in the Vector Database."}},"required":["prompt"]},"RagCustomDatabaseNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/InnerTokenRequest"}},"required":["token"]}]},"RagCustomDatabaseNativeToolConfig":{"type":"object","properties":{"url":{"type":"string","description":"URL of the database."},"type":{"allOf":[{"$ref":"#/components/schemas/RagCustomDatabaseType"}]},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"collectionName":{"type":"string","description":"Name of the database collection."}},"required":["url","type","entityType","collectionName"]},"RagCustomDatabaseType":{"type":"string","enum":["qdrant"],"description":"Type of the database."},"RagEntityType":{"type":"string","enum":["product"],"description":"Type of the entity which is stored in the given collection."},"InnerTokenRequest":{"type":"object","properties":{"id":{"type":"string","description":"ID of the token."}},"required":["id"]},"RagCustomEmbeddingNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/RagCustomEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/InnerTokenRequest"}},"required":["token"]}]},"RagCustomEmbeddingNativeToolConfig":{"type":"object","properties":{"model":{"type":"string","description":"Name of the OpenAI LLM model which should be used to create embedding of user's input in order to perform search operation."}},"required":["model"]},"RagEmporixNativeToolRequest":{"allOf":[{"$ref":"#/components/schemas/BaseNativeTool"},{"type":"object","properties":{"type":{"description":"For `RagEmporixNativeTool`, it has to be set to `rag_emporix`."},"config":{"$ref":"#/components/schemas/RagEmporixNativeToolConfigRequest"},"metadata":{"$ref":"#/components/schemas/MetadataRequest"}},"required":["config"]}]},"RagEmporixNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/RagEmporixNativeToolConfig"},{"type":"object","properties":{"embeddingConfig":{"oneOf":[{"$ref":"#/components/schemas/EmporixOpenAiRagEmporixEmbeddingNativeToolConfig"},{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfigRequest"},{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigRequest"}]}},"required":["embeddingConfig"]}]},"RagEmporixNativeToolConfig":{"type":"object","properties":{"prompt":{"type":"string","description":"The prompt for an agent. It should define when and why this tool is to be called."},"entityType":{"allOf":[{"$ref":"#/components/schemas/RagEntityType"}]},"indexedFields":{"type":"array","description":"This field specifies the fields of the given entityType that are used for generating embeddings. The provided values are then concatenated and converted to embeddings.","items":{"type":"object","properties":{"name":{"type":"string","description":"It can act as an alias for the field key. For example, if the 'name.en' key is provided then its alias could be 'English Name' and that value is used in embedding input."},"key":{"type":"string","description":"Unique value representing the entityType key."}},"required":["key"]}}},"required":["prompt","entityType","indexedFields"]},"EmporixOpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."}},"required":["provider"]},"RagLlmProvider":{"type":"string","enum":["emporix_openai","openai","self_hosted_ollama"]},"OpenAiRagEmporixEmbeddingNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/OpenAiRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/InnerTokenRequest"}},"required":["token"]}]},"OpenAiRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'emporix_openai'."},"model":{"type":"string","description":"OpenAI LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096}},"required":["provider","model","dimensions"]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfigRequest":{"allOf":[{"$ref":"#/components/schemas/SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig"},{"type":"object","properties":{"token":{"$ref":"#/components/schemas/InnerTokenRequest"}},"required":["token"]}]},"SelfHostedOllamaRagEmporixEmbeddingNativeToolConfig":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/RagLlmProvider"}],"description":"For this type, it should be set to 'self_hosted_ollama'."},"model":{"type":"string","description":"Ollama LLM model to be used for generating embeddings for indexed products and user's input query."},"dimensions":{"type":"integer","description":"Number of dimensions of embedding.","minimum":128,"maximum":4096},"url":{"type":"string","description":"Base URL where Ollama is hosted."}},"required":["provider","model","dimensions","url"]}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_resp_common":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"409_resp_common":{"description":"There are three possible reasons:\n 1. Resource with given code already exists, please choose unique code for your resource\n 2. Optimistic locking failed. If user sends metadata/version attribute which is outdated (someone else updated resource in the time user was performing his changes). User should retrieve the latest product data and retry the request.\n 3. Optimistic locking failed. User did not provide metadata/version attribute in update request, but someone else updated product while it was internally handled by product service. Resending the same request can result in successful update, but the update can override recently persisted changes.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBodies":{"toolUpsertBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SlackNativeToolRequest"},{"$ref":"#/components/schemas/RagCustomNativeToolRequest"},{"$ref":"#/components/schemas/RagEmporixNativeToolRequest"}]}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools/{toolId}":{"put":{"summary":"Upserting tool","parameters":[{"$ref":"#/components/parameters/forceDisable"}],"operationId":"PUT-ai-upsert-tool","responses":{"201":{"description":"ID of created tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"}}}},"204":{"description":"The resource has been successfully updated."},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"404":{"$ref":"#/components/responses/404_resp_common"},"409":{"$ref":"#/components/responses/409_resp_common"}},"description":"Updates or creates a specified tool by replacing all of its existing data with data from the request body.\nIf the `metadata.version` is provided then optimistic locking is enabled and version must match the version in the database.`","requestBody":{"$ref":"#/components/requestBodies/toolUpsertBody"},"tags":["Tool"]}}}}
```

## Deleting tool

> Deletes tool by given ID.\
> \
> \*\*\*Important\*\*\*: If tool is being used by an agent then delete operation is not possible without \`force\` flag set to \`true\`.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"parameters":{"force":{"schema":{"type":"boolean"},"in":"query","name":"force","description":"Allows you to remove a given entity even if it is used as a dependency in other entries. In that case, the removed entity is unassigned from other entries."}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_resp_common":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools/{toolId}":{"delete":{"parameters":[{"$ref":"#/components/parameters/force"}],"summary":"Deleting tool","operationId":"DELETE-ai-delete-tool","responses":{"204":{"description":"Given tool has been deleted."},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"404":{"$ref":"#/components/responses/404_resp_common"}},"description":"Deletes tool by given ID.\n\n***Important***: If tool is being used by an agent then delete operation is not possible without `force` flag set to `true`.","tags":["Tool"]}}}}
```

## Partially updating tool

> Partially updates a single tool document with given information.\
> Single update may contain multiple partial updates in the form of an array. It contains the allowed operations list:\
> &#x20; \- \`add\` (adding an item to the items list)\
> &#x20; \- \`remove\` (removing an item from the items list)\
> &#x20; \- \`replace\` (replacing an item with given ID with new definition)

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Tool","description":"Manage Tools"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.agent_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"parameters":{"forceDisable":{"schema":{"type":"boolean"},"in":"query","name":"force","description":"Allows you to disable a given entity even if it is used as a dependency in other entries. In that case, cascade disable is performed."}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_resp_common":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"PatchRequest":{"type":"array","description":"Partial update operation list.","items":{"type":"object","properties":{"op":{"anyOf":[{"enum":["ADD","REMOVE","REPLACE"]}],"type":"string"},"path":{"type":"string"},"value":{"anyOf":[{"type":"string","description":"Value of the string type."},{"type":"object","description":"Any part of the details object."}]}},"required":["op","path"]}}},"requestBodies":{"toolPatchBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchRequest"}}}}}},"paths":{"/ai-service/{tenant}/agentic/tools/{toolId}":{"patch":{"summary":"Partially updating tool","parameters":[{"$ref":"#/components/parameters/forceDisable"}],"operationId":"PATCH-ai-update-tool","responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"404":{"$ref":"#/components/responses/404_resp_common"}},"description":"Partially updates a single tool document with given information.\nSingle update may contain multiple partial updates in the form of an array. It contains the allowed operations list:\n  - `add` (adding an item to the items list)\n  - `remove` (removing an item from the items list)\n  - `replace` (replacing an item with given ID with new definition)","requestBody":{"$ref":"#/components/requestBodies/toolPatchBody"},"tags":["Tool"]}}}}
```
