Get an agent
You can retrieve agent information using the agent_id.
Path and HTTP methods
GET /_plugins/_agent/agents/<agent_id>
note
Agent, tool, and MCP APIs now use the preferred _plugins/_agent namespace. The legacy _plugins/_ml/... route still works for backward compatibility but is deprecated and will be removed in a future release.
Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Description |
|---|---|---|
agent_id | String | The agent ID of the agent to retrieve. |
Example request
GET /_plugins/_agent/agents/N8AE1osB0jLkkocYjz7D
Example response
{
"name": "Test_Agent_For_RAG",
"type": "flow",
"description": "this is a test agent",
"tools": [
{
"type": "SearchIndexTool",
"parameters": {
"input": "{\"index\": \"my_test_data\", \"query\": {\"size\": 3, \"query\": {\"neural\": {\"embedding\": {\"query_text\": \"${parameters.question}\", \"model_id\": \"zBRyYIsBls05QaITo5ex\", \"k\": 3}}}}}"
},
"include_output_in_agent_response": false
},
{
"type": "MLModelTool",
"description": "A general tool to answer any question",
"parameters": {
"model_id": "ygAzT40Bdo8gePIqxk0H",
"prompt": """
Human:You are a professional data analyst. You will always answer question based on the given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you don't know the answer, just say don't know.
Context:
${parameters.SearchIndexTool.output}
Human:${parameters.question}
Assistant:"""
},
"include_output_in_agent_response": false
}
],
"created_time": 1706821658743,
"last_updated_time": 1706821658743
}
Response fields
For response field descriptions, see Register Agent API request fields.