trakt_start_scrobbling
Start scrobbling your Plex media playback progress to Trakt.tv in real time.
Instructions
Enable real-time scrobbling to Trakt.tv
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ratingKey | Yes | Plex media rating key | |
| title | Yes | Media title | |
| type | Yes | Media type | |
| progress | Yes | Current progress percentage (0-100) | |
| duration | No | Total duration in milliseconds |
Implementation Reference
- src/trakt/mcp-functions.ts:357-389 (handler)The main handler function that executes the trakt_start_scrobbling tool logic. It takes session data (ratingKey, title, type, progress, duration) and returns a success response indicating scrobbling capability was initialized.
async traktStartScrobbling(sessionData: { ratingKey: string; title: string; type: 'movie' | 'episode'; progress: number; duration?: number; }): Promise<Record<string, unknown>> { if (!this.isInitialized) { this.initializeTraktClient(); } try { // This would integrate with real Plex session monitoring // For now, demonstrate the capability return { success: true, message: 'Scrobbling capability initialized', note: 'Real-time scrobbling requires integration with Plex webhook system', sessionData: { ratingKey: sessionData.ratingKey, title: sessionData.title, type: sessionData.type, progress: sessionData.progress } }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to start scrobbling' }; } } - src/trakt/tool-schemas.ts:60-74 (schema)Input schema definition for the trakt_start_scrobbling tool, specifying the name, description, and input properties (ratingKey, title, type, progress, duration).
{ name: "trakt_start_scrobbling", description: "Enable real-time scrobbling to Trakt.tv", inputSchema: { type: "object" as const, properties: { ratingKey: { type: "string", description: "Plex media rating key" }, title: { type: "string", description: "Media title" }, type: { type: "string", enum: ["movie", "episode"], description: "Media type" }, progress: { type: "number", description: "Current progress percentage (0-100)" }, duration: { type: "number", description: "Total duration in milliseconds" }, }, required: ["ratingKey", "title", "type", "progress"], }, }, - src/trakt/tool-registry.ts:40-48 (registration)Registration of the trakt_start_scrobbling tool in the Trakt tool registry, mapping it to the traktStartScrobbling function with argument extraction.
registry.register("trakt_start_scrobbling", (args) => traktFunctions.traktStartScrobbling({ ratingKey: args.ratingKey as string, title: args.title as string, type: args.type as "movie" | "episode", progress: args.progress as number, duration: args.duration as number | undefined, }).then(wrapResponse) );