Skip to main content
Glama
paulsham

Wiki Analytics Specification MCP Server

by paulsham

search_events

Find analytics events by name, description, table, or property usage to query and validate event specifications from Wiki markdown tables.

Instructions

Search for events by name, description, table, or property usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch term for event name or description
tableNoFilter by event table
has_propertyNoFilter events that include this property

Implementation Reference

  • The core handler function for the 'search_events' tool. It filters the list of events based on optional query (name/description), table, or presence of a specific property (via expansion), then returns a summary list with event details and property counts.
    handler: async (args) => { let results = [...events]; // Filter by query if (args.query) { const query = args.query.toLowerCase(); results = results.filter(e => e.event_name.toLowerCase().includes(query) || e.event_description.toLowerCase().includes(query) ); } // Filter by table if (args.table) { const table = args.table.toLowerCase(); results = results.filter(e => e.event_table.toLowerCase().includes(table) ); } // Filter by property if (args.has_property) { results = results.filter(e => { const expanded = getExpandedProperties(e); const allProps = [ ...expanded.property_groups.flatMap(g => g.properties.map(p => p.name)), ...expanded.additional_properties.map(p => p.name) ]; return allProps.includes(args.has_property); }); } return results.map(e => { const expanded = getExpandedProperties(e); const propertyCount = expanded.property_groups.reduce((sum, g) => sum + g.properties.length, 0) + expanded.additional_properties.length; return { event_name: e.event_name, description: e.event_description, table: e.event_table, property_count: propertyCount }; }); }
  • Input schema for the 'search_events' tool, defining optional parameters: query (string), table (string), has_property (string).
    inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search term for event name or description' }, table: { type: 'string', description: 'Filter by event table' }, has_property: { type: 'string', description: 'Filter events that include this property' } } },
  • Registration of all tools (including 'search_events') via the generic CallToolRequestSchema handler, which dynamically retrieves the tool by name from the imported 'tools' object and invokes its handler.
    // Handle tool calls 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 } ] }; });
  • Registration for listing all tools (including 'search_events') via ListToolsRequestSchema, exposing name, description, and inputSchema 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