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
#[schemars(description = "Number of log entries to skip (default: 0)")]
177
177
offset:Option<u32>,
178
-
#[schemars(description = "Log level to filter by (e.g., \"error\", \"warning\", \"info\") (optional)")]
179
-
level:Option<String>,
178
+
#[schemars(description = "Log level to filter by (e.g., \"error\", \"warning\", \"info\")")]
179
+
level:String,
180
180
#[schemars(description = "Log tag to filter by (e.g., \"wazuh-modulesd\") (optional)")]
181
181
tag:Option<String>,
182
182
#[schemars(description = "Search term to filter log descriptions (optional)")]
@@ -801,20 +801,18 @@ impl WazuhToolsServer {
801
801
}
802
802
803
803
#[tool(
804
-
name = "get_wazuh_running_agents",
804
+
name = "get_wazuh_agents",
805
805
description = "Retrieves a list of Wazuh agents with their current status and details. Returns formatted agent information including ID, name, IP, status, OS details, and last activity. Supports filtering by status, name, IP, group, OS platform, and version."
806
806
)]
807
-
808
-
asyncfnget_wazuh_running_agents(
807
+
asyncfnget_wazuh_agents(
809
808
&self,
810
-
#[tool(aggr)]params:GetRunningAgentsParams,
809
+
#[tool(aggr)]params:GetAgentsParams,
811
810
) -> Result<CallToolResult,McpError>{
812
811
let limit = params.limit.unwrap_or(100);
813
-
let status = params.status.as_deref().unwrap_or("active");// Default to active agents
814
812
815
813
tracing::info!(
816
814
limit = %limit,
817
-
status = %status,
815
+
status = ?params.status,
818
816
name = ?params.name,
819
817
ip = ?params.ip,
820
818
group = ?params.group,
@@ -831,7 +829,7 @@ impl WazuhToolsServer {
831
829
None,// select
832
830
None,// sort
833
831
None,// search
834
-
Some(status),
832
+
Some(¶ms.status),
835
833
None,// query
836
834
None,// older_than
837
835
params.os_platform.as_deref(),
@@ -851,7 +849,7 @@ impl WazuhToolsServer {
851
849
if agents.is_empty(){
852
850
tracing::info!("No Wazuh agents found matching criteria. Returning standard message.");
@@ -1589,7 +1617,11 @@ impl ServerHandler for WazuhToolsServer {
1589
1617
- 'get_wazuh_agent_processes': Retrieves a list of running processes for a specific Wazuh agent. \
1590
1618
Requires an 'agent_id' parameter (formatted as described for other agent-specific tools). Supports 'limit' (default 100) and 'search' (to filter by process name or command line) parameters.\n\
1591
1619
- 'get_wazuh_agent_ports': Retrieves a list of open network ports for a specific Wazuh agent. \
1592
-
Requires an 'agent_id' parameter (formatted as described for other agent-specific tools). Supports 'limit' (default 100), 'protocol' (e.g., \"tcp\", \"udp\"), and 'state' (e.g., \"LISTEN\", \"ESTABLISHED\") parameters to filter the results. Note: State filtering is performed client-side by this server.\n\
1620
+
Requires an 'agent_id' parameter (formatted as described for other agent-specific tools). Supports 'limit' (default 100), 'protocol' (e.g., \"tcp\", \"udp\"), and 'state' (e.g., \"LISTENING\", \"ESTABLISHED\") parameters to filter the results. Note: State filtering is performed client-side by this server.\n\
1621
+
The 'state' parameter filters results:
1622
+
- If 'state' is 'LISTENING' (case-insensitive): Only ports explicitly in the 'LISTENING' state are returned. Ports with other states, no state, or an empty state string are filtered out.
1623
+
- If 'state' is any other value (e.g., 'ESTABLISHED'): Ports that are *not* in the 'LISTENING' state are returned. This includes ports with other defined states (like 'ESTABLISHED', 'TIME_WAIT', etc.) and ports that have *no state* defined. Ports with an empty state string are always filtered out.
1624
+
Note: State filtering is performed client-side by this server. \
0 commit comments