history_detail
Retrieve detailed download and import history records from media management services to monitor transfer activities and track media workflows.
Instructions
Get download/import history details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| pageSize | No | ||
| service | Yes | ||
| since | No |
Implementation Reference
- src/services/shared.ts:316-352 (handler)Core handler implementation for the history_detail tool. Fetches history records from the ARR API /history endpoint, processes up to 20 recent items, formats them into HistoryItem objects, and returns structured HistoryData.async historyDetail( options: HistoryOptions = {}, ): Promise<OperationResult<HistoryData>> { try { const params: Record<string, string | number> = {}; if (options.page) params.page = options.page; if (options.pageSize) params.pageSize = options.pageSize; if (options.since) params.since = options.since; const response: HistoryResponse = await fetchJson( this.buildApiUrl("/history", params), ); const records = response.records || []; const items = records.slice(0, 20).map((item: HistoryRecord) => ({ id: item.id, title: item.sourceTitle || item.title, quality: item.quality?.quality?.name || "Unknown", date: item.date, eventType: item.eventType, mediaKind: this.mediaKind, })); return { ok: true, data: { service: this.serviceName, mediaKind: this.mediaKind, total: response.totalRecords || records.length, items, truncated: records.length > 20, }, }; } catch (error) { return handleError(error, this.serviceName); } }
- src/index.ts:76-85 (schema)Input schema definition for the history_detail tool, specifying parameters like service (required), page, pageSize, and since.inputSchema: { type: "object", properties: { service: { type: "string" }, page: { type: "number" }, pageSize: { type: "number" }, since: { type: "string" }, }, required: ["service"], },
- src/index.ts:292-297 (registration)Dispatch/registration logic in the main tool handler that routes 'history_detail' calls to the service.historyDetail method.case "history_detail": return await service.historyDetail({ page: input.page, pageSize: input.pageSize, since: input.since, });
- src/services/base.ts:81-102 (schema)TypeScript interfaces defining the input options (HistoryOptions), item structure (HistoryItem), and output data shape (HistoryData) for the history_detail functionality.export interface HistoryOptions { page?: number; pageSize?: number; since?: string; } export interface HistoryItem { id: number; title: string; quality: string; date: string; eventType: string; mediaKind: "series" | "movie"; } export interface HistoryData { service: string; mediaKind: "series" | "movie"; total: number; items: HistoryItem[]; truncated: boolean; }
- src/index.ts:73-86 (registration)Tool registration entry in the tools list returned by listTools, including name, description, and inputSchema for history_detail.{ name: "history_detail", description: "Get download/import history details", inputSchema: { type: "object", properties: { service: { type: "string" }, page: { type: "number" }, pageSize: { type: "number" }, since: { type: "string" }, }, required: ["service"], }, },