Skip to main content
Glama

privacy

Retrieve app privacy labels and data usage details from App Store listings to understand how applications handle user information.

Instructions

Get app privacy labels and data usage information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesiTunes trackId of the app

Implementation Reference

  • Handler function that implements the core logic of the 'privacy' tool: fetches privacy data from App Store API using buildPrivacyUrl, parses it with parsePrivacy, and returns formatted JSON response or error.
    /** * Privacy tool - Get app privacy labels */ async function handlePrivacy(args) { try { const { id } = args; if (!id) { throw new Error('id is required'); } const url = buildPrivacyUrl({ id }); const data = await fetchJSON(url); const privacy = parsePrivacy(data); if (!privacy) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'Privacy data not available' }, null, 2), }, ], }; } return { content: [ { type: 'text', text: JSON.stringify(privacy, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ error: error.message }, null, 2), }, ], isError: true, }; } }
  • Input schema definition for the 'privacy' tool in the ListTools response, requiring 'id' as a number (iTunes trackId).
    { name: 'privacy', description: 'Get app privacy labels and data usage information', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'iTunes trackId of the app', }, }, required: ['id'], }, },
  • Maps the 'privacy' tool name to the handlePrivacy function in the CallToolRequestSchema handler switch statement.
    case 'privacy': return await handlePrivacy(args);
  • Helper function that parses and normalizes the raw JSON response from the App Store privacy API into a structured object.
    export function parsePrivacy(data) { if (!data || typeof data !== 'object') { return null; } return { managePrivacyChoicesUrl: data.managePrivacyChoicesUrl || null, privacyTypes: (data.privacyTypes || []).map(privacyType => ({ privacyType: privacyType.privacyType || null, identifier: privacyType.identifier || null, description: privacyType.description || null, dataCategories: (privacyType.dataCategories || []).map(category => ({ dataCategory: category.dataCategory || null, identifier: category.identifier || null, dataTypes: category.dataTypes || [], })), purposes: privacyType.purposes || [], })), }; }
  • Helper function that builds the URL for fetching app privacy details from the iTunes API.
    export function buildPrivacyUrl(params) { const { id } = params; if (!id) { throw new Error('id must be provided for privacy data'); } return `${ITUNES_BASE}/us/app-privacy-details/${id}.json`; }

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/MiguelAlvRed/mobile-store-scraper-mcp'

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