20a8987dd9
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.
26 lines
865 B
Python
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
|