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
[agent builder] Clarify how APIs work with Kibana Spaces (elastic#3636)
Contributes to the non-generated API docs component of
elastic/docs-content-internal#434
- Creates a new section explaining Spaces behavior
- Links to that section from each `curl` example using a reusable
snippet
---------
Co-authored-by: florent-leborgne <[email protected]>
Copy file name to clipboardExpand all lines: solutions/search/agent-builder/kibana-api.md
+54-4Lines changed: 54 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ applies_to:
10
10
11
11
# Work with {{agent-builder}} using the APIs
12
12
13
-
This page provides a quick overview of the main Kibana API endpoints for {{agent-builder}}. For complete details including all available parameters, request/response schemas, and error handling, refer to the [Kibana serverless API reference](https://www.elastic.co/docs/api/doc/serverless/group/endpoint-agent-builder).
13
+
This page provides a quick overview of the main {{kib}} API endpoints for {{agent-builder}}. For complete details including all available parameters, request/response schemas, and error handling, refer to the [{{kib}} serverless API reference](https://www.elastic.co/docs/api/doc/serverless/group/endpoint-agent-builder).
14
14
15
15
These APIs allow you to programmatically work with the {{agent-builder}} abstractions.
16
16
@@ -21,7 +21,7 @@ The examples in this documentation use Dev Tools [Console](/explore-analyze/quer
21
21
GET kbn://api/agent_builder/tools
22
22
```
23
23
24
-
To use these APIs with tools like `curl`, replace the `kbn://` protocol with your Kibana URL.
24
+
To use these APIs with tools like `curl`, replace the `kbn://` protocol with your {{kib}} URL.
25
25
26
26
:::{note}
27
27
Set the required environment variables before running curl commands:
@@ -40,6 +40,21 @@ To generate API keys, search for `API keys` in the [global search bar](/explore-
To run APIs in non-default [spaces](/deploy-manage/manage-spaces.md), you must include the space identifier in the URL when making API calls with `curl` or other external tools. Insert `/s/<space_name>` before `/api/agent_builder` in your requests.
46
+
47
+
For example, to list tools in a space named `my-space`:
48
+
49
+
```bash
50
+
curl -X GET "https://${KIBANA_URL}/s/my-space/api/agent_builder/tools" \
51
+
-H "Authorization: ApiKey ${API_KEY}"
52
+
```
53
+
54
+
The default space does not require the `/s/default` prefix.
55
+
56
+
Dev Tools [Console](/explore-analyze/query-filter/tools/console.md) automatically uses your current space context and does not require the `/s/<space_name>` prefix.
57
+
43
58
## Available APIs
44
59
45
60
% TODO: we may remove this list once the API reference is live, but probably helpful in the short term
@@ -66,6 +81,8 @@ GET kbn://api/agent_builder/tools
66
81
curl -X GET "https://${KIBANA_URL}/api/agent_builder/tools" \
67
82
-H "Authorization: ApiKey ${API_KEY}"
68
83
```
84
+
:::{include} _snippets/spaces-api-note.md
85
+
:::
69
86
:::
70
87
71
88
::::
@@ -130,6 +147,8 @@ curl -X POST "https://${KIBANA_URL}/api/agent_builder/tools" \
130
147
}
131
148
}'
132
149
```
150
+
:::{include} _snippets/spaces-api-note.md
151
+
:::
133
152
:::
134
153
135
154
::::
@@ -154,6 +173,8 @@ GET kbn://api/agent_builder/tools/{id}
154
173
curl -X GET "https://${KIBANA_URL}/api/agent_builder/tools/{id}" \
@@ -648,9 +695,10 @@ curl -X POST "https://${KIBANA_URL}/api/agent_builder/mcp" \
648
695
"method": "tools/list"
649
696
}'
650
697
```
698
+
If you're using Spaces, you need to prefix `/api/agent_builder` with `/s/<space_name>`. Refer to [Working with Spaces](#working-with-spaces).
651
699
652
700
:::{note}
653
-
This endpoint uses the JSON-RPC protocol. The MCP server is used by AI clients like Claude Desktop, Cursor, and VS Code extensions to access your Elastic tools. Use this Kibana API endpoint for testing MCP connectivity or debugging protocol communication. This endpoint requires JSON-RPC formatting and does not work from the Dev Tools Console.
701
+
This endpoint uses the JSON-RPC protocol. The MCP server is used by AI clients like Claude Desktop, Cursor, and VS Code extensions to access your Elastic tools. Use this {{kib}} API endpoint for testing MCP connectivity or debugging protocol communication. This endpoint requires JSON-RPC formatting and does not work from the Dev Tools Console.
654
702
:::
655
703
656
704
### A2A protocol
@@ -677,6 +725,8 @@ GET kbn://api/agent_builder/a2a/{agentId}.json
677
725
curl -X GET "https://${KIBANA_URL}/api/agent_builder/a2a/{agentId}.json" \
678
726
-H "Authorization: ApiKey ${API_KEY}"
679
727
```
728
+
:::{include} _snippets/spaces-api-note.md
729
+
:::
680
730
:::
681
731
682
732
::::
@@ -725,4 +775,4 @@ curl -X GET "https://${KIBANA_URL}/api/agent_builder/a2a/{agentId}.json" \
725
775
726
776
## API reference
727
777
728
-
For the full API documentation, refer to the [Kibana serverless API reference](https://www.elastic.co/docs/api/doc/serverless/group/endpoint-agent-builder).
778
+
For the full API documentation, refer to the [{{kib}} serverless API reference](https://www.elastic.co/docs/api/doc/serverless/group/endpoint-agent-builder).
0 commit comments