Low Risk

query_sampled_traces

SECONDARY TRACE TOOL - Query AWS X-Ray traces (5% sampled data) for trace investigation. ⚠️ **IMPORTANT: Consider using audit_slos() with auditors="all" instead for comprehensive root cause analysis** **RECOMMENDED WORKFLOW FOR OPERATION DISCOVERY:** 1. **Use `get_service_detail(service_name)` ...

Admin/system-level operation

Part of the CloudWatch Application Signals MCP Server MCP server. Enforce policies on this tool with Intercept, the open-source MCP proxy.

AI agents call query_sampled_traces to retrieve information from CloudWatch Application Signals MCP Server without modifying any data. This is common in research, monitoring, and reporting workflows where the agent needs context before taking action. Because read operations don't change state, they are generally safe to allow without restrictions -- but you may still want rate limits to control API costs.

Even though query_sampled_traces only reads data, uncontrolled read access can leak sensitive information or rack up API costs. An agent caught in a retry loop could make thousands of calls per minute. A rate limit gives you a safety net without blocking legitimate use.

Read-only tools are safe to allow by default. No rate limit needed unless you want to control costs.

cloudwatch-application-signals-mcp-server.yaml
tools:
  query_sampled_traces:
    rules:
      - action: allow

See the full CloudWatch Application Signals MCP Server policy for all 22 tools.

Tool Name query_sampled_traces
Category Read
Risk Level Low

View all 22 tools →

Agents calling read-class tools like query_sampled_traces have been implicated in these attack patterns. Read the full case and prevention policy for each:

Browse the full MCP Attack Database →

Other tools in the Read risk category across the catalogue. The same policy patterns (rate-limit, allow) apply to each.

What does the query_sampled_traces tool do? +

SECONDARY TRACE TOOL - Query AWS X-Ray traces (5% sampled data) for trace investigation. ⚠️ **IMPORTANT: Consider using audit_slos() with auditors="all" instead for comprehensive root cause analysis** **RECOMMENDED WORKFLOW FOR OPERATION DISCOVERY:** 1. **Use `get_service_detail(service_name)` FIRST** to discover operations from metric dimensions 2. **Use audit_slos() with auditors="all"** for comprehensive root cause analysis (PREFERRED) 3. Only use this tool if you need specific trace filtering that other tools don't provide **RECOMMENDED WORKFLOW FOR SLO BREACH INVESTIGATION:** 1. Use get_slo() to understand SLO configuration 2. **Use audit_slos() with auditors="all"** for comprehensive root cause analysis (PREFERRED) 3. Only use this tool if you need specific trace filtering that audit_slos() doesn't provide **WHY audit_slos() IS PREFERRED:** - **Comprehensive analysis**: Combines traces, logs, metrics, and dependencies - **Actionable recommendations**: Provides specific steps to resolve issues - **Integrated findings**: Correlates multiple data sources for better insights - **Much more effective** than individual trace analysis **WHY get_service_detail() IS PREFERRED FOR OPERATION DISCOVERY:** - **Direct operation discovery**: Operations are available in metric dimensions - **More reliable**: Uses Application Signals service metadata instead of sampling - **Comprehensive**: Shows all operations, not just those in sampled traces ⚠️ **LIMITATIONS OF THIS TOOL:** - Uses X-Ray's **5% sampled trace data** - may miss critical errors - **Limited context** compared to comprehensive audit tools - **No integrated analysis** with logs, metrics, or dependencies - **May miss operations** due to sampling - use get_service_detail() for complete operation discovery - For 100% trace visibility, enable Transaction Search and use search_transaction_spans() **Use this tool only when:** - You need specific X-Ray filter expressions not available in audit tools - You're doing exploratory trace analysis outside of SLO breach investigation - You need raw trace data for custom analysis - **After using get_service_detail() for operation discovery** **For operation discovery, use get_service_detail() instead:** ``` get_service_detail(service_name='your-service-name') ``` **For SLO breach root cause analysis, use audit_slos() instead:** ``` audit_slos( slo_targets='[{"Type":"slo","Data":{"Slo":{"SloName":"your-slo-name"}}}]', auditors='all' ) ``` Common filter expressions (if you must use this tool): - 'service("service-name"){fault = true}': Find all traces with faults (5xx errors) for a service - 'service("service-name")': Filter by specific service - 'duration > 5': Find slow requests (over 5 seconds) - 'http.status = 500': Find specific HTTP status codes - 'annotation[aws.local.operation]="GET /owners/*/lastname"': Filter by specific operation (from metric dimensions) - 'annotation[aws.remote.operation]="ListOwners"': Filter by remote operation name - Combine filters: 'service("api"){fault = true} AND annotation[aws.local.operation]="POST /visits"' Returns JSON with trace summaries including: - Trace ID for detailed investigation - Duration and response time - Error/fault/throttle status - HTTP information (method, status, URL) - Service interactions - User information if available - Exception root causes (ErrorRootCauses, FaultRootCauses, ResponseTimeRootCauses) **RECOMMENDATION: Use get_service_detail() for operation discovery and audit_slos() with auditors="all" for comprehensive root cause analysis instead of this tool.** Returns: JSON string containing trace summaries with error status, duration, and service details. It is categorised as a Read tool in the CloudWatch Application Signals MCP Server MCP Server, which means it retrieves data without modifying state.

How do I enforce a policy on query_sampled_traces? +

Add a rule in your Intercept YAML policy under the tools section for query_sampled_traces. You can allow, deny, rate-limit, or validate arguments. Then run Intercept as a proxy in front of the CloudWatch Application Signals MCP Server MCP server.

What risk level is query_sampled_traces? +

query_sampled_traces is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit query_sampled_traces? +

Yes. Add a rate_limit block to the query_sampled_traces rule in your Intercept policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block query_sampled_traces completely? +

Set action: deny in the Intercept policy for query_sampled_traces. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides query_sampled_traces? +

query_sampled_traces is provided by the CloudWatch Application Signals MCP Server MCP server (awslabs.cloudwatch-applicationsignals-mcp-server). Intercept sits as a proxy in front of this server to enforce policies before tool calls reach the server.

Let agents act without letting them run wild.

Deterministic policy on every MCP tool call. Per-identity grants. Full audit log.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.