Skip to content

Commit 3219ba7

Browse files
Merge branch 'main' into update-agent-builder-docs-for-9.2
2 parents 09e6422 + 2829c33 commit 3219ba7

File tree

4 files changed

+152
-16
lines changed

4 files changed

+152
-16
lines changed

solutions/search/agent-builder/tools.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ Tool namespacing helps organize and identify tools by their source. Built-in too
6868

6969
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:
7070

71-
- **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.
72-
- **Explicit query tools**: Define tools with explicit {{esql}} queries for precise, pre-defined data retrieval operations.
71+
- **[Index search tools](tools/index-search-tools.md)**: 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.
72+
- **[ES|QL tools](tools/esql-tools.md)**: Define tools with explicit {{esql}} queries for precise, pre-defined data retrieval operations.
73+
7374

7475
This flexibility allows you to create tools that match your specific use cases and data access patterns.
7576

@@ -107,15 +108,15 @@ You can create custom tools to help agents interact with your data in specific w
107108
:width: 150px
108109
:::
109110

110-
3. Fill in the required fields:
111+
4. Fill in the required fields:
111112
- **Name**: Enter a descriptive name for your tool.
112113
- **Description**: Write a clear explanation of what the tool does and when it should be used.
113-
- **Tool type**: Choose either **{{esql}}** query or **Index search**.
114+
- **Tool type**: Choose either **[{{esql}}](tools/esql-tools.md)** or **[Index search](tools/index-search-tools.md).**
114115
- **Parameters**: For tools with {{esql}} queries, define any parameters your query needs.
115116
- **Tags**: (Optional) Add labels to categorize and organize your tools.
116-
4. Choose how to save your tool:
117+
5. Choose how to save your tool:
117118
- Select **Save** to create the tool.
118-
- Select **Save and test** to create the tool and immediately open the testing interface.
119+
- Select **Save and test** to create the tool and immediately open the testing interface
119120

120121
:::{image} images/tool-save-save-and-test-buttons.png
121122
:alt: Save and Save and test buttons for tool creation
@@ -211,4 +212,4 @@ The **Tools** UI provides a **Copy your MCP server URL** button for easy access.
211212
:width: 250px
212213
:::
213214

214-
For detailed MCP server configuration, refer to [MCP server](mcp-server.md).
215+
For detailed MCP server configuration, refer to [MCP server](mcp-server.md).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
navigation_title: "ES|QL tools"
3+
applies_to:
4+
stack: preview 9.2
5+
serverless:
6+
elasticsearch: preview
7+
---
8+
9+
:::{warning}
10+
These pages are currently hidden from the docs TOC and have `noindexed` meta headers.
11+
12+
**Go to the docs [landing page](/solutions/search/elastic-agent-builder.md).**
13+
:::
14+
15+
# {{esql}} tools
16+
17+
{{esql}} query tools enable you to create parameterized queries that execute directly against your {{es}} data. These custom tools provide precise control over data retrieval through templated [{{esql}}](elasticsearch://reference/query-languages/esql.md) statements.
18+
19+
## When to use {{esql}} tools
20+
21+
Use custom **{{esql}} tools** when:
22+
23+
* You need precise control over the query logic
24+
* Your use case involves repeatable analytical patterns
25+
* You want to expose specific, parameterized queries to agents
26+
* Results should be in a predictable tabular format
27+
* You have well-defined data retrieval requirements
28+
29+
## Key characteristics
30+
31+
* Execute pre-defined {{esql}} queries with dynamic parameters
32+
* Support typed parameters
33+
* Return results in tabular format for structured data analysis
34+
* Ideal for repeatable analytical queries with variable inputs
35+
36+
## Parameter types
37+
38+
{{esql}} tools support the following parameter types:
39+
40+
* **String types**: `text`, `keyword`
41+
* **Numeric types**: `long`, `integer`, `double`, `float`
42+
* **Other types**: `boolean`, `date`, `object`, `nested`
43+
44+
## Parameter options
45+
46+
Parameters can be configured as:
47+
48+
* **Required**: Must be provided by the agent when calling the tool
49+
* **Optional**: Can be omitted; uses `null` if no default is specified
50+
51+
## Query syntax
52+
53+
In your {{esql}} query, reference parameters using the `?parameter_name` syntax. The agent will automatically interpolate parameter values when executing the query.
54+
55+
56+
## Best practices
57+
58+
- **Include LIMIT clauses**: Prevent returning excessive results by setting reasonable limits
59+
- **Use meaningful parameter names**: Choose names that clearly indicate what the parameter represents (e.g., `start_date` instead of `date1`)
60+
- **Provide clear descriptions**: Help agents understand when and how to use each parameter
61+
62+
## {{esql}} documentation
63+
64+
To learn more about the language, refer to the [{{esql}} docs](elasticsearch://reference/query-languages/esql.md).
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
navigation_title: "Index search tools"
3+
applies_to:
4+
stack: preview 9.2
5+
serverless:
6+
elasticsearch: preview
7+
---
8+
9+
:::{warning}
10+
These pages are currently hidden from the docs TOC and have `noindexed` meta headers.
11+
12+
**Go to the docs [landing page](/solutions/search/elastic-agent-builder.md).**
13+
:::
14+
15+
# Index search tools
16+
17+
Index search tools provide intelligent, natural language-driven search over specified {{es}} resources. Instead of defining explicit queries, you specify a pattern of [indices](/manage-data/data-store/index-basics.md), [aliases](/manage-data/data-store/aliases.md), or [data streams](/manage-data/data-store/data-streams.md), and the tool uses a combination of built-in capabilities to intelligently interpret and execute search requests.
18+
19+
## When to use index search tools
20+
21+
Use custom **Index search tools** when:
22+
23+
* You want agents to handle diverse, exploratory queries
24+
* The search intent varies significantly across requests
25+
* Users need flexible, ad-hoc search functionality
26+
* You want to scope general search capabilities to specific indices
27+
28+
## Key characteristics
29+
30+
* Accept natural language queries from the agent
31+
* Automatically determine optimal search strategy (full-text, semantic)
32+
* Leverage built-in tools like index exploration, query generation, and semantic search
33+
* Ideal for flexible, user-driven exploratory searches
34+
* No need to pre-define query logic
35+
36+
## Configuration
37+
38+
Index search tools require only a single configuration parameter:
39+
40+
* **`pattern`**: An index pattern string (e.g., `logs-*`, `my-index`, `.alerts-*`) specifying which indices, aliases, or data streams to search
41+
42+
## How it works
43+
44+
When an agent calls an index search tool:
45+
46+
1. The agent provides a natural language query (e.g., "find recent errors related to authentication")
47+
2. The tool analyzes the query intent and available indices
48+
3. It automatically orchestrates built-in tools to:
49+
- Explore the index structure and mappings
50+
- Generate appropriate queries ({{esql}} or query DSL)
51+
- Execute semantic search if relevant
52+
- Rank and format results
53+
4. Returns results in a format the agent can interpret and present
54+
55+
56+
## Best practices
57+
58+
- **Use specific patterns**: Scope tools to relevant index patterns rather than broad wildcards (e.g., `logs-myapp-*` instead of `logs-*`)
59+
- **Write descriptive tool names**: Help agents select the right tool for the query (e.g., "Search Security Alerts" vs. "Search Tool")
60+
- **Provide context in descriptions**: Explain what data the indices contain and what types of questions the tool can answer
61+
- **Create domain-specific tools**: Build separate tools for different data domains (logs, metrics, alerts) rather than one general-purpose tool
62+
63+
64+
## Common patterns
65+
66+
* **Wildcard patterns**: `logs-*`, `metrics-*`, `events-*`
67+
* **Specific indices**: `products`, `users`, `orders`
68+
* **System indices**: `.alerts-security-*`, `.ml-anomalies-*`
69+
* **All resources**: `*`

solutions/toc.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project: 'Solutions and use cases'
1+
project: "Solutions and use cases"
22
toc:
33
- file: index.md
44
- file: search.md
@@ -50,6 +50,8 @@ toc:
5050
- hidden: search/agent-builder/chat.md
5151
- hidden: search/agent-builder/agent-builder-agents.md
5252
- hidden: search/agent-builder/tools.md
53+
- hidden: search/agent-builder/tools/esql-tools.md
54+
- hidden: search/agent-builder/tools/index-search-tools.md
5355
- hidden: search/agent-builder/programmatic-access.md
5456
- hidden: search/agent-builder/kibana-api.md
5557
- hidden: search/agent-builder/mcp-server.md
@@ -458,13 +460,13 @@ toc:
458460
- file: observability/logs/logs-index-template-defaults.md
459461
- file: observability/streams/streams.md
460462
children:
461-
- file: observability/streams/management/extract.md
462-
children:
463-
- file: observability/streams/management/extract/date.md
464-
- file: observability/streams/management/extract/dissect.md
465-
- file: observability/streams/management/extract/grok.md
466-
- file: observability/streams/management/retention.md
467-
- file: observability/streams/management/advanced.md
463+
- file: observability/streams/management/extract.md
464+
children:
465+
- file: observability/streams/management/extract/date.md
466+
- file: observability/streams/management/extract/dissect.md
467+
- file: observability/streams/management/extract/grok.md
468+
- file: observability/streams/management/retention.md
469+
- file: observability/streams/management/advanced.md
468470
- file: observability/incident-management.md
469471
children:
470472
- file: observability/incident-management/alerting.md
@@ -747,4 +749,4 @@ toc:
747749
- file: security/advanced-entity-analytics/privileged-user-monitoring-setup.md
748750
- file: security/advanced-entity-analytics/monitor-privileged-user-activitites.md
749751
- file: security/asset-management.md
750-
- file: security/apis.md
752+
- file: security/apis.md

0 commit comments

Comments
 (0)