You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: solutions/search/agent-builder/tools.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,9 @@ Tools enable agents to work with {{es}} data. When an agent receives a natural l
24
24
25
25
Each tool is an atomic operation with a defined signature - accepting typed parameters and returning structured results in a format the agent can parse, transform, and incorporate into its response generation.
26
26
27
-
## Tool types
27
+
## Built-in tools
28
28
29
-
There are two main types of tools in {{agent-builder}}:
30
-
31
-
-**{{esql}} tools**: Execute [{{esql}}](elasticsearch://reference/query-languages/esql.md) queries against your indices, allowing agents to retrieve and analyze data using the Elasticsearch query language.
32
-
-**Index tools**: Provide core capabilities for working with indices, enabling you to search indices, retrieve documents by ID, view index mappings, discover relevant indices, and list available indices.
33
-
34
-
{{agent-builder}} ships with a set of built-in built-in tools whose names are dot-prefixed. For example: `.execute_esql`.
35
-
Users can also create [custom tools](#create-custom-tools).
29
+
{{agent-builder}} ships with a comprehensive set of built-in tools that provide core capabilities for working with your {{es}} data. These tools are ready to use. They cannot be modified or deleted.
36
30
37
31
Key built-in tools include:
38
32
@@ -44,7 +38,16 @@ Key built-in tools include:
44
38
-**`.list_indices`**: Lists the indices in the {{es}} cluster the current user has access to
45
39
-**`.search`**: A powerful tool for searching and analyzing data within a specific {{es}} index
46
40
47
-
Built-in tools cannot be modified or deleted, but serve as building blocks for more complex interactions.
41
+
Built-in tools serve as building blocks for more complex interactions and provide the foundation for agent capabilities.
42
+
43
+
## Custom tools
44
+
45
+
You can extend the built-in tool catalog with your own custom tool definitions. Custom tools offer flexibility in how they interact with your data:
46
+
47
+
-**Scoped tools**: Define tools that are scoped to a specific index or pattern, allowing the LLM to decide how to query those indices based on the user's request
48
+
-**Explicit query tools**: Define tools with explicit {{esql}} queries for precise, pre-defined data retrieval operations
49
+
50
+
This flexibility allows you to create tools that match your specific use cases and data access patterns.
48
51
49
52
### Find available tools
50
53
@@ -64,11 +67,11 @@ Parameters enable tools to be dynamic and adaptable to different queries. Each p
64
67
- A **type** (such as keyword, number, boolean)
65
68
- A **description** that helps the agent understand when and how to use it
66
69
67
-
For {{esql}} tools, parameters are defined in the query using the syntax `?parameter_name` and must be configured when creating the tool.
70
+
For tools with explicit queries, parameters are defined in the query using the syntax `?parameter_name` and must be configured when creating the tool.
68
71
69
72
Parameters can be:
70
73
-**Manually defined**: You explicitly define the parameters a tool needs
71
-
-**Inferred from query**: For {{esql}} tools, you can use the "Infer parameters from query" button to automatically detect parameters in your {{esql}} statement
74
+
-**Inferred from query**: For tools with explicit queries, you can use the "Infer parameters from query" button to automatically detect parameters in your query statement
72
75
73
76
Providing clear, descriptive parameter names and descriptions helps agents properly use your tools when answering queries.
74
77
@@ -84,16 +87,16 @@ You can create custom tools to help agents interact with your data in specific w
84
87
4. Fill in the required fields:
85
88
-**Name**: Enter a descriptive name for your tool
86
89
-**Description**: Write a clear explanation of what the tool does and when it should be used
87
-
- Tool-specific configuration ({{esql}} query or index settings)
88
-
-**Parameters**: For {{esql}} tools, define any parameters your query needs
90
+
- Tool-specific configuration (explicit query or index settings)
91
+
-**Parameters**: For tools with explicit queries, define any parameters your query needs
89
92
-**Tags**: (Optional) Add labels to categorize and organize your tools
90
93
5. Click **Save** to create your tool
91
94
92
95
### Use the API
93
96
94
97
You can also create tools programmatically:
95
98
96
-
For {{esql}} tools:
99
+
For tools with explicit {{esql}} queries:
97
100
98
101
```json
99
102
POST kbn://api/agent_builder/tools
@@ -118,7 +121,7 @@ POST kbn://api/agent_builder/tools
118
121
2. Detailed description that helps the agent understand when to use this tool
119
122
3. {{esql}} query with parameters prefixed by `?`
120
123
4. Parameter definition including type and description
121
-
5. Tool type specifier (use "esql" for {{esql}} tools)
124
+
5. Tool type specifier (use "esql" for tools with explicit {{esql}} queries)
122
125
6. Optional tags for categorization
123
126
124
127
For index search tools:
@@ -143,8 +146,6 @@ POST kbn://api/agent_builder/tools
143
146
4. Fields within the index that should be searchable
144
147
5. Tool type specifier (use `index_search` for index search tools)
145
148
6. Optional tags for organization
146
-
7.**Use appropriate tags**: Add relevant tags to make tools easier to find and organize
147
-
8.**Limit tool count**: More tools are not always better. Try to keep each agent focused with a limited number of relevant tools.
148
149
149
150
### Testing your tools
150
151
@@ -165,7 +166,7 @@ Testing helps ensure your tool returns useful results and handles parameters cor
165
166
3.**Limit scope**: Focus each tool on a specific task rather than creating overly complex tools
166
167
4.**Use meaningful parameter names**: Choose names that clearly indicate what the parameter represents
167
168
5.**Add comprehensive parameter descriptions**: Help the agent understand what values to use
168
-
6.**Include `LIMIT` clauses in {{esql}} queries**: Prevent returning excessive results
169
+
6.**Include `LIMIT` clauses in explicit queries**: Prevent returning excessive results
169
170
7.**Use appropriate tags**: Add relevant tags to make tools easier to find and organize
170
171
8.**Limit tool count**: More tools are not always better. Try to keep each agent focused with a limited number of relevant tools.
0 commit comments