Skip to main content
Glama

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
NameRequiredDescriptionDefault
pageNo
pageSizeNo
serviceYes
sinceNo

Implementation Reference

  • 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);
    	}
    }
  • 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,
      });
  • 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"],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thesammykins/FlixBridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server