From fd0e8d539bd4d9d26bd183e1411eeddefa5d32f7 Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Fri, 30 Jan 2026 10:23:58 -0500 Subject: [PATCH 1/4] fix webhook api handling --- .../cases_webhook/service.test.ts | 31 +++++++++++++++++++ .../connector_types/cases_webhook/utils.ts | 5 +++ 2 files changed, 36 insertions(+) diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts index 301768fbb70bb..405b553904c8b 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts @@ -1397,6 +1397,37 @@ describe('Cases webhook service', () => { '[Action][Webhook - Case Management]: Unable to update case with id 1. Error: Unsupported content type: text/html in GET https://example.com. Supported content types: application/json.' ); }); + + it('it should throw if the request status is a 204 and has data', async () => { + requestMock.mockImplementation(() => + createAxiosResponse({ + data: 'some data', + headers: { ['content-type']: 'text/html' }, + status: 204, + }) + ); + + await expect(service.updateIncident(incident)).rejects.toThrow( + '[Action][Webhook - Case Management]: Unable to update case with id 1. Error: Unsupported content type: text/html in GET https://example.com. Supported content types: application/json.' + ); + }); + + it('it should NOT throw if the request status is a 204 and is empty', async () => { + requestMock.mockImplementation(() => + createAxiosResponse({ + data: undefined, + headers: { ['content-type']: 'text/html' }, + status: 204, + }) + ); + + await expect(service.updateIncident(incident)).resolves.toEqual({ + id: '1', + title: undefined, + pushedDate: mockTime.toISOString(), + url: 'https://coolsite.net/browse/undefined', + }); + }); }); describe('createComment', () => { diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts index 6013dae31e1ac..786851e87ff38 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts @@ -43,6 +43,11 @@ export const throwDescriptiveErrorIfResponseIsNotValid = ({ const contentType = res.headers['content-type']; const data = res.data; + // If status is 204 and there is no data, we just return + if (res.status === 204 && isEmpty(data)) { + return; + } + /** * Check that the content-type of the response is application/json. * Then includes is added because the header can be application/json;charset=UTF-8. From dfa2bd121d0919f606b16961dff6af8c9432c17a Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Mon, 2 Feb 2026 10:57:10 -0500 Subject: [PATCH 2/4] add check for empty requiredAttributes list --- .../cases_webhook/utils.test.ts | 26 +++++++++++++++++++ .../connector_types/cases_webhook/utils.ts | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.test.ts index 8e73e1d6682fd..a069e11869fb4 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.test.ts @@ -64,6 +64,32 @@ describe('cases_webhook/utils', () => { headers: new AxiosHeaders({}), }, }; + + it('Does not throw when the response status is 204 and there is no data', () => { + expect(() => + throwDescriptiveErrorIfResponseIsNotValid({ + res: { + ...res, + status: 204, + data: undefined, + }, + }) + ).not.toThrow(); + }); + + it('Throws when the response status is 204 and requiredAttributesToBeInTheResponse is set', () => { + expect(() => + throwDescriptiveErrorIfResponseIsNotValid({ + res: { + ...res, + status: 204, + data: undefined, + }, + requiredAttributesToBeInTheResponse: ['field.simple'], + }) + ).toThrow(); + }); + it('Throws error when missing content-type', () => { expect(() => throwDescriptiveErrorIfResponseIsNotValid({ diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts index 786851e87ff38..fba45fcaae58c 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/utils.ts @@ -44,7 +44,7 @@ export const throwDescriptiveErrorIfResponseIsNotValid = ({ const data = res.data; // If status is 204 and there is no data, we just return - if (res.status === 204 && isEmpty(data)) { + if (res.status === 204 && isEmpty(data) && requiredAttributesToBeInTheResponse.length === 0) { return; } From 3c0d6ee7249a2fee386a2e0ca22dbec40d5eb9dc Mon Sep 17 00:00:00 2001 From: Michael Olorunnisola Date: Mon, 2 Feb 2026 16:09:48 -0500 Subject: [PATCH 3/4] fix test --- .../cases_webhook/service.test.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts index 405b553904c8b..988ca022b1e8e 100644 --- a/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts +++ b/x-pack/platform/plugins/shared/stack_connectors/server/connector_types/cases_webhook/service.test.ts @@ -1413,7 +1413,8 @@ describe('Cases webhook service', () => { }); it('it should NOT throw if the request status is a 204 and is empty', async () => { - requestMock.mockImplementation(() => + // Initial mock for the update call + requestMock.mockImplementationOnce(() => createAxiosResponse({ data: undefined, headers: { ['content-type']: 'text/html' }, @@ -1421,11 +1422,21 @@ describe('Cases webhook service', () => { }) ); + // Second mock for the getIncident call inside updateIncident + requestMock.mockImplementationOnce(() => + createAxiosResponse({ + data: { + id: '1', + key: 'CK-1', + }, + }) + ); + await expect(service.updateIncident(incident)).resolves.toEqual({ id: '1', - title: undefined, + title: 'CK-1', pushedDate: mockTime.toISOString(), - url: 'https://coolsite.net/browse/undefined', + url: 'https://coolsite.net/browse/CK-1', }); }); }); From f20248b48df60443813ec1f46833481b19a21edf Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:25:07 +0000 Subject: [PATCH 4/4] Changes from yarn openapi:bundle --- oas_docs/bundle.json | 182 +++++++++++++++++++++++++++++--- oas_docs/bundle.serverless.json | 182 +++++++++++++++++++++++++++++--- 2 files changed, 336 insertions(+), 28 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index f8ef17734e065..5b24d56d09730 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -1222,7 +1222,7 @@ }, "/api/agent_builder/agents": { "get": { - "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents", "parameters": [], "responses": { @@ -1293,7 +1293,7 @@ "x-state": "Added in 9.2.0" }, "post": { - "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-agents", "parameters": [ { @@ -1465,7 +1465,7 @@ }, "/api/agent_builder/agents/{id}": { "delete": { - "description": "Delete an agent by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete an agent by ID. This action cannot be undone. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-agents-id", "parameters": [ { @@ -1512,7 +1512,7 @@ "x-state": "Added in 9.2.0" }, "get": { - "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents-id", "parameters": [ { @@ -1571,7 +1571,7 @@ "x-state": "Added in 9.2.0" }, "put": { - "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-agents-id", "parameters": [ { @@ -2483,7 +2483,7 @@ }, "/api/agent_builder/converse": { "post": { - "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/chat).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-converse", "parameters": [ { @@ -2954,9 +2954,19 @@ }, "/api/agent_builder/mcp": { "post": { - "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.\nTo learn more, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-mcp", - "parameters": [], + "parameters": [ + { + "description": "Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.", + "in": "query", + "name": "namespace", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -3021,7 +3031,7 @@ }, "/api/agent_builder/tools": { "get": { - "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools", "parameters": [], "responses": { @@ -3195,7 +3205,7 @@ "x-state": "Added in 9.2.0" }, "post": { - "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-tools", "parameters": [ { @@ -3398,7 +3408,7 @@ }, "/api/agent_builder/tools/_execute": { "post": { - "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-tools-execute", "parameters": [ { @@ -3703,7 +3713,7 @@ }, "/api/agent_builder/tools/{toolId}": { "delete": { - "description": "Delete a tool by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete a tool by ID. This action cannot be undone. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-tools-toolid", "parameters": [ { @@ -3750,7 +3760,7 @@ "x-state": "Added in 9.2.0" }, "get": { - "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools-toolid", "parameters": [ { @@ -3887,7 +3897,7 @@ "x-state": "Added in 9.2.0" }, "put": { - "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "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](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-tools-toolid", "parameters": [ { @@ -57355,6 +57365,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -62268,6 +62301,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -65416,6 +65450,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -70329,6 +70386,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -73011,6 +73069,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -77924,6 +78005,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -80721,6 +80803,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -85634,6 +85739,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -88269,6 +88375,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -93182,6 +93311,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -95790,6 +95920,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -100703,6 +100856,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index e95f2b7d8af5a..a484eca3e7e04 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -1222,7 +1222,7 @@ }, "/api/agent_builder/agents": { "get": { - "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available agents. Use this endpoint to retrieve complete agent information including their current configuration and assigned tools. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents", "parameters": [], "responses": { @@ -1293,7 +1293,7 @@ "x-state": "" }, "post": { - "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new agent. Use this endpoint to define the agent's behavior, appearance, and capabilities through comprehensive configuration options. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-agents", "parameters": [ { @@ -1465,7 +1465,7 @@ }, "/api/agent_builder/agents/{id}": { "delete": { - "description": "Delete an agent by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete an agent by ID. This action cannot be undone. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-agents-id", "parameters": [ { @@ -1512,7 +1512,7 @@ "x-state": "" }, "get": { - "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific agent by ID. Use this endpoint to retrieve the complete agent definition including all configuration details and tool assignments. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-agents-id", "parameters": [ { @@ -1571,7 +1571,7 @@ "x-state": "" }, "put": { - "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Update an existing agent configuration. Use this endpoint to modify any aspect of the agent's behavior, appearance, or capabilities. To learn more, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-agents-id", "parameters": [ { @@ -2483,7 +2483,7 @@ }, "/api/agent_builder/converse": { "post": { - "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Send a message to an agent and receive a complete response. This synchronous endpoint waits for the agent to fully process your request before returning the final result. Use this for simple chat interactions where you need the complete response. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/chat).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-converse", "parameters": [ { @@ -2954,9 +2954,19 @@ }, "/api/agent_builder/mcp": { "post": { - "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "> warn\n> This endpoint is designed for MCP clients (Claude Desktop, Cursor, VS Code, etc.) and should not be used directly via REST APIs. Use MCP Inspector or native MCP clients instead.\nTo learn more, refer to the [MCP documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/mcp-server).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-mcp", - "parameters": [], + "parameters": [ + { + "description": "Comma-separated list of namespaces to filter tools. Only tools matching the specified namespaces will be returned.", + "in": "query", + "name": "namespace", + "required": false, + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -3021,7 +3031,7 @@ }, "/api/agent_builder/tools": { "get": { - "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "List all available tools. Use this endpoint to retrieve complete tool definitions including their schemas and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools", "parameters": [], "responses": { @@ -3195,7 +3205,7 @@ "x-state": "" }, "post": { - "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Create a new tool. Use this endpoint to define a custom tool with specific functionality and configuration for use by agents. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "post-agent-builder-tools", "parameters": [ { @@ -3398,7 +3408,7 @@ }, "/api/agent_builder/tools/_execute": { "post": { - "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Execute a tool with parameters. Use this endpoint to run a tool directly with specified inputs and optional external connector integration. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "post-agent-builder-tools-execute", "parameters": [ { @@ -3703,7 +3713,7 @@ }, "/api/agent_builder/tools/{toolId}": { "delete": { - "description": "Delete a tool by ID. This action cannot be undone.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "Delete a tool by ID. This action cannot be undone. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "delete-agent-builder-tools-toolid", "parameters": [ { @@ -3750,7 +3760,7 @@ "x-state": "" }, "get": { - "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements.

[Required authorization] Route required privileges: read_agent_builder.", + "description": "Get a specific tool by ID. Use this endpoint to retrieve the complete tool definition including its schema and configuration requirements. To learn more, refer to the [tools documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: read_agent_builder.", "operationId": "get-agent-builder-tools-toolid", "parameters": [ { @@ -3887,7 +3897,7 @@ "x-state": "" }, "put": { - "description": "Update an existing tool. Use this endpoint to modify any aspect of the tool's configuration or metadata.

[Required authorization] Route required privileges: manage_agent_builder.", + "description": "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](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/tools).

[Required authorization] Route required privileges: manage_agent_builder.", "operationId": "put-agent-builder-tools-toolid", "parameters": [ { @@ -56423,6 +56433,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -61336,6 +61369,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -64484,6 +64518,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -69397,6 +69454,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -72079,6 +72137,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -76992,6 +77073,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -79789,6 +79871,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -84702,6 +84807,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -87337,6 +87443,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -92250,6 +92379,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": { @@ -94858,6 +94988,29 @@ "description": "A non-empty string.", "minLength": 1, "type": "string" + }, + "downsample": { + "items": { + "additionalProperties": false, + "properties": { + "after": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + }, + "fixed_interval": { + "description": "A non-empty string.", + "minLength": 1, + "type": "string" + } + }, + "required": [ + "after", + "fixed_interval" + ], + "type": "object" + }, + "type": "array" } }, "type": "object" @@ -99771,6 +99924,7 @@ "minLength": 1, "type": "string" }, + "minItems": 1, "type": "array" }, "ignore_failure": {