Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inspect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx @modelcontextprotocol/inspector python3 "$(pwd)/tmll/mcp/server.py" "$(pwd)/tmll/mcp/cli.py"
4 changes: 1 addition & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ TMLL provides an MCP (Model Context Protocol) server that exposes trace analysis
- `analyze_correlation`: Perform root cause correlation analysis
- `detect_idle_resources`: Identify underutilized resources
- `plan_capacity`: Run capacity planning predictions
- `plot_xy_with_anomalies`: Return an interactive XY anomaly plot (MCP App iframe UI)

## CLI Usage

Expand Down Expand Up @@ -176,9 +177,6 @@ tmll_cli.py detect-idle --experiment <UUID> --threshold 5

# Run capacity planning
tmll_cli.py plan-capacity --experiment <UUID> --horizon 30

# Perform clustering
tmll_cli.py cluster --experiment <UUID> --method kmeans --n-clusters 3
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion tmll/common/services/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class Logger:
logger.remove()
logger.add(sys.stdout, colorize=True, format="{message}")
logger.add(sys.stderr, colorize=True, format="{message}")

def __init__(self, name: str, verbose: bool = True) -> None:
self.name = name
Expand Down
11 changes: 8 additions & 3 deletions tmll/mcp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ def detect_anomalies(args):
print("No outputs found matching criteria")
return

ad = AnomalyDetection(client, experiment, outputs, resample_freq=args.resample_freq, min_size=args.min_size)
ad_kwargs = {}
if args.resample_freq:
ad_kwargs["resample_freq"] = args.resample_freq
if args.min_size is not None:
ad_kwargs["min_size"] = args.min_size
ad = AnomalyDetection(client, experiment, outputs, **ad_kwargs)
result = ad.find_anomalies(method=args.method)

if args.plot:
Expand Down Expand Up @@ -297,8 +302,8 @@ def main():
anomaly_parser.add_argument("-k", "--keywords", nargs="+", default=["cpu usage"], help="Output keywords")
anomaly_parser.add_argument("-m", "--method", default="iforest", help="Detection method")
anomaly_parser.add_argument("-p", "--plot", action="store_true", help="Plot anomalies")
anomaly_parser.add_argument("-H", "--resample-freq", default="1s", help="Resampling frequency")
anomaly_parser.add_argument("-s", "--min-size", type=int, default=10, help="Minimum data points")
anomaly_parser.add_argument("-H", "--resample-freq", help="Resampling frequency")
anomaly_parser.add_argument("-s", "--min-size", type=int, help="Minimum data points")
anomaly_parser.set_defaults(func=detect_anomalies)

# memory-leak command
Expand Down
Loading
Loading