get_event_implementation
Retrieve complete analytics event specifications with expanded properties for implementing tracking code in applications.
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 core handler function implementing the tool logic: retrieves the event from eventsMap, expands properties using getExpandedProperties helper, 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)Input schema defining the required 'event_name' parameter for the tool.inputSchema: { type: 'object', properties: { event_name: { type: 'string', description: 'Name of the event to retrieve' } }, required: ['event_name'] },
- src/mcp-server/index.js:79-103 (registration)MCP CallTool request handler that dispatches tool calls to the specific tool handler based on name, formats the response, and prepends outdated warnings if applicable.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const tool = tools[name]; if (!tool) { throw new Error(`Unknown tool: ${name}`); } const result = await tool.handler(args || {}); // Prepend outdated warning if present let responseText = JSON.stringify(result, null, 2); if (outdatedWarning) { responseText = `⚠️ Warning: ${outdatedWarning}\n\n${responseText}`; } return { content: [ { type: 'text', text: responseText } ] }; });
- src/mcp-server/index.js:68-76 (registration)MCP ListTools request handler that lists all available tools including get_event_implementation with their descriptions and schemas.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(tools).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
- src/mcp-server/data.js:94-136 (helper)Helper function called by the handler to expand an event's property groups and additional properties into detailed property objects with types, constraints, and descriptions.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; }