-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(sources/elasticsearch): add Elasticsearch source and tools #1109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
duwenxin99
merged 39 commits into
googleapis:main
from
Anaethelion:elasticsearch_integration
Nov 6, 2025
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a75bc4f
feat: add elasticsearch support
Anaethelion 36dc246
feat(source): add elasticsearch source
Anaethelion 6f476a2
feat(tools): add elasticsearch tools
Anaethelion e3eb881
feat(docs): add documentation for elasticsearch
Anaethelion 451420c
Tests: format yaml with spaces
Anaethelion 8085c96
Tools: remove search, list_indices and get_mappings, will reintroduce…
Anaethelion 5f13889
refactor(tools): remove list_indices and get_index_mappings; update e…
Anaethelion b50df0f
cleanup: remove common.go and tests
Anaethelion c45a1ea
refactor(tests): update elasticsearchesql_test to use customizable li…
Anaethelion d3378a4
fix(elasticsearchesql): make params field optional in request body st…
Anaethelion a4abec6
test(elasticsearch): add integration tests for Elasticsearch tool end…
Anaethelion f4627f6
refactor(docs): remove Elasticsearch tool entries from documentation
Anaethelion e83e398
feat(elasticsearch): add support for username/password authentication
Anaethelion 27bf009
refactor(elasticsearch): remove Elasticsearch tool entries from confi…
Anaethelion 3e72c86
docs(elasticsearch): update ESQL documentation for query parameters a…
Anaethelion d19f36b
feat(elasticsearch): update esql tool Invoke method to include access…
Anaethelion c80337b
update test config
duwenxin99 1c2e338
go mod tidy
duwenxin99 a0d8457
fix: re-add Firebird and Firestore SQL tools that were wrongly deleted.
Anaethelion 6ccc008
feat(elasticsearch): refine query handling by conditionally setting q…
Anaethelion 861e574
feat(elasticsearch): update ESQL tool parameters to accept dynamic qu…
Anaethelion b03f8fe
feat(elasticsearch): refactor test setup and enhance tool configurati…
Anaethelion 1cf4062
feat(elasticsearch): update ESQL parameters to allow optional query i…
Anaethelion 4d20471
chore(elasticsearch): add license information to elasticsearch.yaml p…
Anaethelion 0529c6b
feat(elasticsearch): add mcpMyFailToolWant to integration tests
Anaethelion 349c9e5
feat(elasticsearch): re-add Elasticsearch integration test step in cl…
Anaethelion 4471db1
feat(elasticsearch): update FilterPath to include columns and modify …
Anaethelion ba194c5
feat(elasticsearch): update response structure in integration tests t…
Anaethelion 18ad2a6
integration tests: add WithMyAuthToolWant option to InvokeTestConfig
Anaethelion 92afc0d
feat(elasticsearch): introduce esqlResult struct and refactor respons…
Anaethelion ae92301
feat(elasticsearch): add tests for esqlToMap function
Anaethelion c8aad88
update: refactor McpManifest creation using GetMcpManifest function
Anaethelion 33fb873
refactor(elasticsearch): remove unused fields from TestTool_esqlToMap
Anaethelion ddc0182
feat(elasticsearch): parameterize email in Elasticsearch wants
Anaethelion d13a628
Merge branch 'main' into elasticsearch_integration
duwenxin99 95f2cae
Update elasticsearch_integration_test.go
duwenxin99 2041127
Update elasticsearch_integration_test.go
duwenxin99 c00b9e1
Update elasticsearch_integration_test.go
duwenxin99 5b7c379
Merge branch 'main' into elasticsearch_integration
duwenxin99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| --- | ||
| title: "Elasticsearch" | ||
| type: docs | ||
| weight: 1 | ||
| description: > | ||
| Elasticsearch is a distributed, free and open search and analytics engine | ||
| for all types of data, including textual, numerical, geospatial, structured, | ||
| and unstructured. | ||
| --- | ||
|
|
||
| # Elasticsearch Source | ||
|
|
||
| [Elasticsearch][elasticsearch-docs] is a distributed, free and open search and analytics engine | ||
| for all types of data, including textual, numerical, geospatial, structured, | ||
| and unstructured. | ||
|
|
||
| If you are new to Elasticsearch, you can learn how to | ||
| [set up a cluster and start indexing data][elasticsearch-quickstart]. | ||
|
|
||
| Elasticsearch uses [ES|QL][elasticsearch-esql] for querying data. ES|QL | ||
| is a powerful query language that allows you to search and aggregate data in | ||
| Elasticsearch. | ||
|
|
||
| See the [official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) for more information. | ||
|
|
||
| [elasticsearch-docs]: https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html | ||
| [elasticsearch-quickstart]: https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html | ||
| [elasticsearch-esql]: https://www.elastic.co/guide/en/elasticsearch/reference/current/esql.html | ||
|
|
||
| ## Available Tools | ||
|
|
||
| - [`elasticsearch-esql`](../tools/elasticsearch/elasticsearch-esql.md) | ||
| Execute ES|QL queries. | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### API Key | ||
|
|
||
| Toolbox uses an [API key][api-key] to authorize and authenticate when | ||
| interacting with [Elasticsearch][elasticsearch-docs]. | ||
|
|
||
| In addition to [setting the API key for your server][set-api-key], you need to | ||
| ensure the API key has the correct permissions for the queries you intend to | ||
| run. See [API key management][api-key-management] for more information on | ||
| applying permissions to an API key. | ||
|
|
||
| [api-key]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html | ||
| [set-api-key]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html | ||
| [api-key-management]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html | ||
|
|
||
| ## Example | ||
|
|
||
| ```yaml | ||
| sources: | ||
| my-elasticsearch-source: | ||
| kind: "elasticsearch" | ||
| addresses: | ||
| - "http://localhost:9200" | ||
| apikey: "my-api-key" | ||
| ``` | ||
|
|
||
| ## Reference | ||
|
|
||
| | **field** | **type** | **required** | **description** | | ||
| |-----------|:--------:|:------------:|-------------------------------------------------------------------------------| | ||
| | kind | string | true | Must be "elasticsearch". | | ||
| | addresses | []string | true | List of Elasticsearch hosts to connect to. | | ||
| | apikey | string | true | The API key to use for authentication. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: "Elasticsearch" | ||
| type: docs | ||
| weight: 1 | ||
| description: > | ||
| Tools that work with Elasticsearch Sources. | ||
| --- |
45 changes: 45 additions & 0 deletions
45
docs/en/resources/tools/elasticsearch/elasticsearch-esql.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| title: "elasticsearch-esql" | ||
| type: docs | ||
| weight: 2 | ||
| description: > | ||
| Execute ES|QL queries. | ||
| --- | ||
|
|
||
| # elasticsearch-esql | ||
|
|
||
| Execute ES|QL queries. | ||
|
|
||
| This tool allows you to execute ES|QL queries against your Elasticsearch | ||
| cluster. You can use this to perform complex searches and aggregations. | ||
|
|
||
| See the [official documentation](https://www.elastic.co/docs/reference/query-languages/esql/esql-getting-started) for more information. | ||
|
|
||
| ## Example | ||
|
|
||
| ```yaml | ||
| tools: | ||
| query_my_index: | ||
| kind: elasticsearch-esql | ||
| source: elasticsearch-source | ||
| description: Use this tool to execute ES|QL queries. | ||
| query: | | ||
| FROM my-index | ||
| | KEEP * | ||
| | LIMIT ?limit | ||
| parameters: | ||
| - name: limit | ||
| type: integer | ||
| description: Limit the number of results. | ||
| required: true | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| | **name** | **type** | **required** | **description** | | ||
| |------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| | query | string | false | The ES\|QL query to run. Can also be passed by parameters. | | ||
| | format | string | false | The format of the query. Default is json. Valid values are csv, json, tsv, txt, yaml, cbor, smile, or arrow. | | ||
| | timeout | integer | false | The timeout for the query in seconds. Default is 60 (1 minute). | | ||
| | parameters | [parameters](../#specifying-parameters) | false | List of [parameters](../#specifying-parameters) that will be used with the ES\|QL query.<br/>Only supports “string”, “integer”, “float”, “boolean”. | | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| sources: | ||
| elasticsearch-source: | ||
| kind: elasticsearch | ||
| addresses: | ||
| - ${ELASTICSEARCH_HOST} | ||
| apikey: ${ELASTICSEARCH_APIKEY} | ||
|
|
||
| tools: | ||
| execute_esql_query: | ||
| kind: elasticsearch-esql | ||
| source: elasticsearch-source | ||
| description: Use this tool to execute ES|QL queries. | ||
| parameters: | ||
| - name: query | ||
| type: string | ||
| description: The ES|QL query to execute. | ||
| toolsets: | ||
| elasticsearch-tools: | ||
| - execute_esql_query |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.