Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

list_events

Find and filter events by title, description, or location to discover available activities and gatherings.

Instructions

List all available events. Optionally filter by search term or location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch term to filter events by title or description
locationNoFilter events by location

Implementation Reference

  • The asynchronous handler function implementing the core logic of the 'list_events' MCP tool. It calls the API client to fetch events (optionally filtered), handles empty results and errors, formats the output using formatEvent, and returns MCP-formatted content.
    async ({ search, location }) => {
      try {
        const apiClient = getClient();
        const events = await apiClient.listEvents({ search, location });
        
        if (events.length === 0) {
          return {
            content: [{ type: 'text', text: 'No events found matching your criteria.' }]
          };
        }
        
        const formatted = events.map(formatEvent).join('\n\n---\n\n');
        return {
          content: [{ type: 'text', text: `Found ${events.length} event(s):\n\n${formatted}` }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true
        };
      }
    }
  • Zod input schema for the list_events tool parameters: optional 'search' and 'location' strings.
    {
      search: z.string().optional().describe('Search term to filter events by title or description'),
      location: z.string().optional().describe('Filter events by location')
    },
  • src/index.ts:55-84 (registration)
    Registration of the 'list_events' tool with the MCP server using server.tool(), including name, description, schema, and handler reference.
    server.tool(
      'list_events',
      'List all available events. Optionally filter by search term or location.',
      {
        search: z.string().optional().describe('Search term to filter events by title or description'),
        location: z.string().optional().describe('Filter events by location')
      },
      async ({ search, location }) => {
        try {
          const apiClient = getClient();
          const events = await apiClient.listEvents({ search, location });
          
          if (events.length === 0) {
            return {
              content: [{ type: 'text', text: 'No events found matching your criteria.' }]
            };
          }
          
          const formatted = events.map(formatEvent).join('\n\n---\n\n');
          return {
            content: [{ type: 'text', text: `Found ${events.length} event(s):\n\n${formatted}` }]
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true
          };
        }
      }
    );
  • Utility function to format an individual Event object into a multi-line human-readable string, used by the list_events handler and other tools.
    function formatEvent(event: Event): string {
      return `Event: ${event.title} (ID: ${event.id})
      Description: ${event.description}
      Location: ${event.location}
      Start: ${event.start_time}
      End: ${event.end_time}
      Capacity: ${event.capacity}
      Organizer: ${event.organizer.username}
      Registered: ${event.is_registered ? 'Yes' : 'No'}`;
    }
  • TypeScript interface defining the EventListParams type used by the apiClient.listEvents method, matching the tool's input schema.
    export interface EventListParams {
      search?: string;
      location?: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions optional filtering but doesn't disclose behavioral traits like pagination, rate limits, authentication requirements, or what 'available' means (e.g., public vs. private events). This leaves significant gaps for a tool with potential complexity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and efficiently adding optional features. Every word earns its place with zero waste, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete. It lacks details on return values (e.g., event fields, pagination), authentication needs, error handling, and how 'available' is defined. For a list tool with potential filtering and sibling complexity, this leaves the agent under-informed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the two parameters. The description adds minimal value by mentioning 'filter by search term or location', which aligns with the schema but doesn't provide additional semantics like format examples or interaction effects. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'events', making the purpose explicit. It distinguishes from siblings like 'get_event' (singular) and 'get_my_hosted_events' (user-specific) by implying a comprehensive listing. However, it doesn't explicitly contrast with all siblings, such as 'get_event_registrations'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as authentication needs, or compare it to siblings like 'get_my_hosted_events' for user-specific lists. Usage is implied only through the action 'list all available events'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/NotoriousArnav/EventHorizon-MCP'

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