Skip to main content
Glama
paulsham

Wiki Analytics Specification MCP Server

by paulsham

search_events

Search for analytics events by name, description, table, or property usage to find implementation details and specifications.

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 handler function for the search_events tool. It filters the list of events based on optional query (name/description), table, or has_property parameters, expands properties to check inclusion, and returns matching events with their basic info and property count.
    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 defining the parameters for the search_events tool: query (string), table (string), has_property (string). All optional.
    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' } } },
  • MCP server request handler for calling tools. It retrieves the tool by name from the imported tools object (including search_events) and invokes its handler.
    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 server request handler for listing available tools. It iterates over the tools object, including search_events, and returns their names, descriptions, and schemas.
    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