get_event_implementation
Retrieve complete analytics event specifications with expanded properties for implementing tracking code in development workflows.
Instructions
Get complete event specification with all properties expanded. Use when implementing tracking code.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_name | Yes | Name of the event to retrieve |
Implementation Reference
- src/mcp-server/tools.js:29-44 (handler)The handler function that implements the core logic of the 'get_event_implementation' tool. It looks up the event by name, expands its properties using getExpandedProperties, handles not found errors, and returns the complete event specification.handler: async (args) => { const event = eventsMap.get(args.event_name); if (!event) { throw new NotFoundError('Event', args.event_name); } const expanded = getExpandedProperties(event); return { event: event.event_name, description: event.event_description, table: event.event_table, notes: event.notes || null, property_groups: expanded.property_groups, additional_properties: expanded.additional_properties }; }
- src/mcp-server/tools.js:19-28 (schema)The input schema for the tool, requiring a single 'event_name' string parameter.inputSchema: { type: 'object', properties: { event_name: { type: 'string', description: 'Name of the event to retrieve' } }, required: ['event_name'] },
- src/mcp-server/tools.js:17-45 (registration)The tool definition and registration within the exported 'tools' object used by the MCP server.get_event_implementation: { description: 'Get complete event specification with all properties expanded. Use when implementing tracking code.', inputSchema: { type: 'object', properties: { event_name: { type: 'string', description: 'Name of the event to retrieve' } }, required: ['event_name'] }, handler: async (args) => { const event = eventsMap.get(args.event_name); if (!event) { throw new NotFoundError('Event', args.event_name); } const expanded = getExpandedProperties(event); return { event: event.event_name, description: event.event_description, table: event.event_table, notes: event.notes || null, property_groups: expanded.property_groups, additional_properties: expanded.additional_properties }; } },
- src/mcp-server/data.js:94-136 (helper)Helper function called by the handler to expand property groups and additional properties with detailed property information from the loaded data maps.export function getExpandedProperties(event) { const result = { property_groups: [], additional_properties: [] }; // Expand property groups const groupNames = splitMultiLine(event.property_groups); for (const groupName of groupNames) { const group = propertyGroupsMap.get(groupName); if (group) { const groupProps = splitMultiLine(group.properties).map(propName => { const prop = propertiesMap.get(propName); return prop ? { name: prop.property_name, type: prop.type, constraints: prop.constraints || null, description: prop.description } : { name: propName, type: 'unknown', constraints: null, description: 'Property not found' }; }); result.property_groups.push({ name: groupName, description: group.description, properties: groupProps }); } } // Expand additional properties const additionalNames = splitMultiLine(event.additional_properties); for (const propName of additionalNames) { const prop = propertiesMap.get(propName); result.additional_properties.push(prop ? { name: prop.property_name, type: prop.type, constraints: prop.constraints || null, description: prop.description } : { name: propName, type: 'unknown', constraints: null, description: 'Property not found' }); } return result; }