Skip to main content
Glama

privacy

Retrieve app privacy labels and data usage details from app stores 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

  • The main handler function for the 'privacy' tool. Fetches app privacy data from the App Store API using buildPrivacyUrl, parses it with parsePrivacy, and returns a JSON-formatted response.
    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, }; } }
  • Tool registration in ListToolsRequestSchema response, defining the 'privacy' tool name, description, and input schema requiring app 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'], }, },
  • Switch case in CallToolRequestSchema handler that routes 'privacy' tool calls to the handlePrivacy function.
    case 'privacy': return await handlePrivacy(args);
  • Helper function that normalizes raw privacy API response into structured privacyTypes with data categories and purposes.
    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 constructs the App Store privacy details JSON endpoint URL from the app trackId.
    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