Skip to main content
Glama
paulsham

Wiki Analytics Specification MCP Server

by paulsham

get_related_events

Find related analytics events within the same table or flow to understand event relationships and implementation context.

Instructions

Find events in the same table/flow as a given event.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_nameYesName of the event to find related events for

Implementation Reference

  • Executes the tool logic: finds all events in the same database table as the input event_name, excluding itself, and returns their names and descriptions.
    handler: async (args) => { const event = eventsMap.get(args.event_name); if (!event) { throw new NotFoundError('Event', args.event_name); } const relatedEvents = events .filter(e => e.event_table === event.event_table && e.event_name !== args.event_name) .map(e => ({ event_name: e.event_name, description: e.event_description })); return { event: args.event_name, table: event.event_table, related_events: relatedEvents }; }
  • Defines the tool's description and input schema, which requires a single 'event_name' string parameter.
    description: 'Find events in the same table/flow as a given event.', inputSchema: { type: 'object', properties: { event_name: { type: 'string', description: 'Name of the event to find related events for' } }, required: ['event_name'] },
  • Registers the CallToolRequestHandler which dynamically invokes the handler for 'get_related_events' (and other tools) based on the tools object imported from tools.js.
    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 } ] }; });
  • Registers the ListToolsRequestHandler which advertises 'get_related_events' (and other tools) from the tools object.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(tools).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });

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