Skip to main content
Glama
mendeel
by mendeel

aggregated_event_property_values

Analyze event property values to understand distributions and identify common patterns across specific date ranges in Mixpanel data.

Instructions

Analyze specific event properties and their values. Useful for understanding property distributions and identifying common values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventYesThe event name to analyze properties for
from_dateYesThe date in yyyy-mm-dd format to begin querying from (inclusive)
limitNoMaximum number of property values to return
project_idNoThe Mixpanel project ID. Optional since it has a default.
propertyYesThe property name to get values for
to_dateYesThe date in yyyy-mm-dd format to query to (inclusive)

Implementation Reference

  • The handler function that implements the tool logic by making a GET request to Mixpanel's /events/properties/values API endpoint to retrieve aggregated property values for a specific event.
    async function handleAggregatedEventPropertyValues(args: any, config: any) { const { project_id = config.DEFAULT_PROJECT_ID, event, property, from_date, to_date, limit = 100 } = args; try { const credentials = `${config.SERVICE_ACCOUNT_USER_NAME}:${config.SERVICE_ACCOUNT_PASSWORD}`; const encodedCredentials = Buffer.from(credentials).toString('base64'); const url = `${config.MIXPANEL_BASE_URL}/events/properties/values?project_id=${project_id}&event=${encodeURIComponent(event)}&name=${encodeURIComponent(property)}&from_date=${from_date}&to_date=${to_date}&limit=${limit}`; const options = { method: 'GET', headers: { 'accept': 'application/json', 'authorization': `Basic ${encodedCredentials}` } }; const response = await fetch(url, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`HTTP error! status: ${response.status} - ${errorText}`); } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data) } ] }; } catch (error: unknown) { console.error("Error fetching event property values:", error); const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error fetching event property values: ${errorMessage}` } ], isError: true }; } }
  • src/index.ts:310-343 (registration)
    Tool registration in the ListTools handler, defining the tool name, description, and input schema for discovery by MCP clients.
    { name: "aggregated_event_property_values", description: "Analyze specific event properties and their values. Useful for understanding property distributions and identifying common values.", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "The Mixpanel project ID. Optional since it has a default." }, event: { type: "string", description: "The event name to analyze properties for" }, property: { type: "string", description: "The property name to get values for" }, from_date: { type: "string", description: "The date in yyyy-mm-dd format to begin querying from (inclusive)" }, to_date: { type: "string", description: "The date in yyyy-mm-dd format to query to (inclusive)" }, limit: { type: "number", description: "Maximum number of property values to return" } }, required: ["event", "property", "from_date", "to_date"] } },
  • src/index.ts:615-616 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes calls to this tool to its handler function.
    case "aggregated_event_property_values": return await handleAggregatedEventPropertyValues(args, { SERVICE_ACCOUNT_USER_NAME, SERVICE_ACCOUNT_PASSWORD, DEFAULT_PROJECT_ID, MIXPANEL_BASE_URL });
  • Input schema definition for the tool, specifying parameters, types, descriptions, and required fields.
    inputSchema: { type: "object", properties: { project_id: { type: "string", description: "The Mixpanel project ID. Optional since it has a default." }, event: { type: "string", description: "The event name to analyze properties for" }, property: { type: "string", description: "The property name to get values for" }, from_date: { type: "string", description: "The date in yyyy-mm-dd format to begin querying from (inclusive)" }, to_date: { type: "string", description: "The date in yyyy-mm-dd format to query to (inclusive)" }, limit: { type: "number", description: "Maximum number of property values to return" } }, required: ["event", "property", "from_date", "to_date"]

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/mendeel/mixpanel-mcp'

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