versionHistory
Retrieve app version history and release notes from app stores using the app's unique identifier.
Instructions
Get app version history with release notes
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "versionHistory"
}
}Input 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:437-475 (handler)Main handler function that fetches the version history URL using buildVersionHistoryUrl, parses the data with parseVersionHistory, and returns the formatted JSON response.
/** * VersionHistory tool - Get app version history */ 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 (schema)Input schema definition for the versionHistory tool, specifying required 'id' parameter and optional 'country'.
{ 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:1461-1462 (registration)Dispatch registration in the CallToolRequestSchema handler switch statement that routes calls to handleVersionHistory.
case 'versionHistory': return await handleVersionHistory(args); - Helper function to parse raw version history data from the API response into a normalized array of version objects.
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 iTunes 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`; }