Spaces method and path for this operation:
put /s/{space_id}/api/agent_builder/tools/{toolId}
Refer to Spaces for more information.
Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata. To learn more, refer to the tools documentation.
[Required authorization] Route required privileges: manage_onechat.
PUT
/api/agent_builder/tools/{toolId}
curl
curl \
-X PUT "https://${KIBANA_URL}/api/agent_builder/tools/{toolId}" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"description": "Updated ES|QL query tool for analyzing financial trades with time filtering",
"tags": ["analytics", "finance", "updated"],
"configuration": {
"query": "FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit",
"params": {
"startTime": {
"type": "date",
"description": "Start time for the analysis in ISO format"
},
"limit": {
"type": "integer",
"description": "Maximum number of results to return"
}
}
}
}'
PUT kbn:/api/agent_builder/tools/{toolId}
{
"description": "Updated ES|QL query tool for analyzing financial trades with time filtering",
"tags": ["analytics", "finance", "updated"],
"configuration": {
"query": "FROM financial_trades | WHERE execution_timestamp >= ?startTime | STATS trade_count=COUNT(*), avg_price=AVG(execution_price) BY symbol | SORT trade_count DESC | LIMIT ?limit",
"params": {
"startTime": {
"type": "date",
"description": "Start time for the analysis in ISO format"
},
"limit": {
"type": "integer",
"description": "Maximum number of results to return"
}
}
}
}
Request examples
Update esql tool request
Example request to update the custom ESQL tool
{
"tags": [
"analytics",
"finance",
"reporting"
],
"description": "Updated ES|QL query tool for comprehensive financial analysis with enhanced filtering",
"configuration": {
"query": "FROM financial_trades | WHERE execution_timestamp >= ?startTime AND symbol LIKE ?symbolPattern | STATS trade_count=COUNT(*), avg_price=AVG(execution_price), total_volume=SUM(quantity) BY symbol | SORT trade_count DESC | LIMIT ?limit",
"params": {
"limit": {
"type": "integer",
"description": "Maximum number of results to return"
},
"startTime": {
"type": "date",
"description": "Start time for the analysis in ISO format"
},
"symbolPattern": {
"type": "keyword",
"description": "Pattern to filter symbols (e.g., 'US_*' for US instruments)"
}
}
}
}
Example request to update the custom Search tool
{
"tags": [
"search",
"finance",
"compliance",
"reporting"
],
"description": "Updated search tool for comprehensive financial data analysis, reporting, and compliance monitoring"
}
Response examples (200)
Update esql tool example
Example response showing the updated ESQL tool
{
"id": "example-esql-tool",
"tags": [
"analytics",
"finance",
"reporting"
],
"type": "esql",
"schema": {
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"startTime",
"symbolPattern",
"limit"
],
"properties": {
"limit": {
"type": "integer",
"description": "Maximum number of results to return"
},
"startTime": {
"type": "string",
"format": "date-time",
"description": "Start time for the analysis in ISO format"
},
"symbolPattern": {
"type": "string",
"description": "Pattern to filter symbols (e.g., 'US_*' for US instruments)"
}
},
"description": "Parameters needed to execute the enhanced query",
"additionalProperties": false
},
"readonly": false,
"description": "Updated ES|QL query tool for comprehensive financial analysis with enhanced filtering",
"configuration": {
"query": "FROM financial_trades | WHERE execution_timestamp >= ?startTime AND symbol LIKE ?symbolPattern | STATS trade_count=COUNT(*), avg_price=AVG(execution_price), total_volume=SUM(quantity) BY symbol | SORT trade_count DESC | LIMIT ?limit",
"params": {
"limit": {
"type": "integer",
"description": "Maximum number of results to return"
},
"startTime": {
"type": "date",
"description": "Start time for the analysis in ISO format"
},
"symbolPattern": {
"type": "keyword",
"description": "Pattern to filter symbols (e.g., 'US_*' for US instruments)"
}
}
}
}
Example response showing the updated Search tool
{
"id": "example-index-search-tool",
"tags": [
"search",
"finance",
"compliance",
"reporting"
],
"type": "index_search",
"schema": {
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"nlQuery"
],
"properties": {
"nlQuery": {
"type": "string",
"description": "A natural language query expressing the search request"
}
},
"additionalProperties": false
},
"readonly": false,
"description": "Updated search tool for comprehensive financial data analysis, reporting, and compliance monitoring",
"configuration": {
"pattern": "financial_*"
}
}