Skip to main content
Glama
paulsham

Wiki Analytics Specification MCP Server

by paulsham

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
NameRequiredDescriptionDefault
event_nameYesName of the event to retrieve

Implementation Reference

  • 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 }; }
  • 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'] },
  • 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 } ] }; });
  • 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 })) }; });
  • 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; }

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/paulsham/wiki-mcp-analytics-test-1.1.0'

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