Files
ai-agents/agents/pirate/tools/__init__.py
T
Eric Jungbauer 20a8987dd9 The Pirate Phase 1.b: Lidarr + Whisparr + Overseerr tools
Adds 9 read-only tools across three new services:
- Lidarr: queue, artist_search, library_stats (music library awareness)
- Whisparr: queue, series_search, library_stats (adult content, v3 API)
- Overseerr: search, requests, request_counts (cross-library availability,
  request tracking via X-Api-Key header reusing arr_get helper)

Fix _common.py urlencode to use %20 instead of + for query values —
Overseerr rejects + as reserved. Safe for all arr services.

Pirate catalog: 11 → 20 tools.
2026-04-20 22:23:26 +00:00

26 lines
865 B
Python

"""Pirate tools — read-only functions the LLM can call.
Each tool module exports a TOOLS list of dicts shaped for Anthropic tool use:
{"name": str, "description": str, "input_schema": {...}, "read_only": True, "fn": callable}
The runtime loads all modules here and builds a combined catalog. The LLM picks
which tool to call; the runtime executes it and returns the result as a tool message.
"""
from . import sonarr, radarr, lidarr, whisparr, qbittorrent, storage, overseerr
def build_catalog():
"""Return a list of all available tools across all modules."""
catalog = []
for mod in (sonarr, radarr, lidarr, whisparr, qbittorrent, storage, overseerr):
catalog.extend(getattr(mod, "TOOLS", []))
return catalog
def find_tool(name):
for t in build_catalog():
if t["name"] == name:
return t
return None