versionHistory
Retrieve app version history and release notes from app stores by providing the app's track ID and country code.
Instructions
Get app version history with release notes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | iTunes trackId of the app | |
| country | No | Two-letter country code (default: us) | us |
Implementation Reference
- src/server.js:440-475 (handler)The main handler function that executes the versionHistory tool: validates input, builds URL, fetches and parses data, returns formatted JSON response or error.async function handleVersionHistory(args) { try { const { id, country = 'us' } = args; if (!id) { throw new Error('id is required'); } const url = buildVersionHistoryUrl({ id, country }); const data = await fetchJSON(url); const history = parseVersionHistory(data); return { content: [ { type: 'text', text: JSON.stringify({ id, versionHistory: history, count: history.length, }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message }, null, 2), }, ], isError: true, }; } }
- src/server.js:1142-1160 (registration)Registration of the versionHistory tool in the ListToolsRequestSchema response, including name, description, and input schema.{ name: 'versionHistory', description: 'Get app version history with release notes', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'iTunes trackId of the app', }, country: { type: 'string', description: 'Two-letter country code (default: us)', default: 'us', }, }, required: ['id'], }, },
- src/server.js:1145-1159 (schema)Input schema definition for the versionHistory tool, specifying required 'id' parameter and optional 'country'.inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'iTunes trackId of the app', }, country: { type: 'string', description: 'Two-letter country code (default: us)', default: 'us', }, }, required: ['id'], },
- Helper function to parse and normalize the raw version history data from the App Store API.export function parseVersionHistory(data) { if (!data || !Array.isArray(data)) { return []; } return data.map(version => ({ versionDisplay: version.versionDisplay || version.version || null, releaseNotes: version.releaseNotes || null, releaseDate: version.releaseDate || null, releaseTimestamp: version.releaseTimestamp || null, })); }
- src/endpoints/appStore.js:139-147 (helper)Helper function to construct the App Store version history API URL.export function buildVersionHistoryUrl(params) { const { id, country = 'us' } = params; if (!id) { throw new Error('id must be provided for version history'); } return `${ITUNES_BASE}/us/app-version-history/${id}.json`; }