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

# Tools Doctor

> Diagnose tool availability and dependencies

## Overview

The Tools Doctor command diagnoses tool availability, checks dependencies, and reports issues with your PraisonAI tools setup.

## Python API

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.templates import ToolsDoctor

# Create doctor instance
doctor = ToolsDoctor()

# Run full diagnostics
result = doctor.diagnose()

# Check results
print(f"praisonai-tools installed: {result['praisonai_tools_installed']}")
print(f"Built-in tools: {len(result['builtin_tools'])}")
print(f"Issues found: {len(result['issues'])}")

# Get JSON output
json_output = doctor.diagnose_json()

# Get human-readable output
human_output = doctor.diagnose_human()
print(human_output)
```

## Diagnostic Results

The `diagnose()` method returns a dictionary with:

| Key                         | Type | Description                                  |
| --------------------------- | ---- | -------------------------------------------- |
| `praisonai_tools_installed` | bool | Whether praisonai-tools package is installed |
| `praisonaiagents_installed` | bool | Whether praisonaiagents is installed         |
| `builtin_tools`             | list | List of available built-in tool names        |
| `praisonai_tools_available` | list | Tools from praisonai-tools package           |
| `custom_tools_dirs`         | list | Status of custom tool directories            |
| `tool_dependencies`         | dict | Optional dependencies for known tools        |
| `issues`                    | list | Detected issues with severity and hints      |

## Custom Tool Directories

The doctor checks these default directories for custom tools:

* `~/.praisonai/tools` (primary)
* `~/.config/praison/tools` (XDG-friendly)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Check with additional custom directories
doctor = ToolsDoctor(custom_dirs=["./my-tools", "~/shared-tools"])
result = doctor.diagnose()

for dir_info in result["custom_tools_dirs"]:
    status = "✓" if dir_info["exists"] else "✗"
    print(f"{status} {dir_info['path']} ({dir_info['tool_count']} tools)")
```

## Tool Dependencies

The doctor checks optional dependencies for known tools:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
result = doctor.diagnose()

for tool, deps in result["tool_dependencies"].items():
    missing = [d["name"] for d in deps if not d["available"]]
    if missing:
        print(f"Tool '{tool}' missing: {', '.join(missing)}")
```

## Issue Severity Levels

| Severity  | Description                                      |
| --------- | ------------------------------------------------ |
| `error`   | Critical issue preventing tool usage             |
| `warning` | Non-critical issue that may affect functionality |
| `info`    | Informational message about optional features    |
