> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trace.probebrowser.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Reference for MCP capabilities.

The MCP Server exposes **96 capabilities** to your AI Agent. This reference helps you understand what the Agent can see and do.

## 🧠 How it Works

You do not call these tools directly. Your AI Agent (Cursor/Claude) automatically selects the right tool based on your natural language request.

* **You say**: "Why is the login failing?"
* **Agent thinks**: *I need to check network requests and console errors.*
* **Agent calls**: `trace_get_network_failed()` and `trace_get_console_errors()`.

## 🗣️ Prompting Guide

To get the best results, guide the Agent towards specific domains:

| Goal | Prompt to use | Triggered Tools |
| :- | :- | :- |
| **Fix a Crash** | "Analyze the console for recent errors and suggested fixes." | `trace_get_console_errors`, `trace_suggest_fix` |
| **Debug API** | "Why did the last request fail? Check headers." | `trace_get_network_failed`, `trace_get_request_headers` |
| **Fix UI** | "Inspect the submit button. Why is it hidden?" | `trace_inspect_element`, `trace_analyze_visibility` |
| **Test Flow** | "Click the signup button and fill the form." | `trace_click`, `trace_type` |

## 📚 Tool Definitions

### `trace_p(prompt)`

Deep Debug. Runs a multi-step AI loop to solve a complex problem.

### 🖥️ Console & Errors

* `trace_get_console_errors`: List all JS exceptions.
* `trace_get_error_groups`: Group errors by stack trace (reduces noise).
* `trace_suggest_fix`: AI-powered fix suggestion for a specific error.
* `trace_explain_call_stack`: Natural language explanation of a crash.

### 🌐 Network

* `trace_get_network_failed`: List 4xx/5xx requests.
* `trace_get_network_summary`: High-level traffic stats.
* `trace_get_request_headers(requestId)`: Inspect headers (Auth, CORS).
* `trace_get_response_body(requestId)`: Read the JSON/HTML response.
* `trace_replay_request(requestId)`: Retry a failed request to test a fix.
* `trace_get_timing_breakdown`: Latency analysis (TTFB, DNS).

### 📄 DOM & UI

* `trace_inspect_element(selector)`: Get computed styles and visibility.
* `trace_get_dom_tree`: Snapshot of the current page structure.
* `trace_check_accessibility`: Run an a11y audit.
* `trace_analyze_visibility`: Find out why an element is hidden.
* `trace_edit_element_style`: Live CSS patching.

### 🖱️ Interaction (Active)

* `trace_click(selector)`: Simulate user click.
* `trace_type(selector, text)`: Fill input fields.
* `trace_hover`: Trigger hover states.
* `trace_scroll`: Move the viewport.
* `trace_wait_for(selector)`: Wait for async loading to finish.

### 🧠 Application State

* `trace_get_cookies`: List/filter cookies.
* `trace_get_local_storage`: Read local storage keys.
* `trace_get_service_workers`: Debug PWA workers.
* `trace_clear_storage`: Wipe state for a fresh test.

### 💾 Code & Source

* `trace_read_file(path)`: Read local source code.
* `trace_git_blame(path, line)`: Find who changed code recently.
* `trace_search_code(query)`: Grep search the project.
* `trace_get_error_context`: Auto-fetch code around a stack trace.

### ⚡ Performance

* `trace_start_cpu_profile`: Record a performance profile.
* `trace_take_heap_snapshot`: Debug memory leaks.
* `trace_get_performance_metrics`: LCP, CLS, and Web Vitals.
