Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

get_event_registrations

Retrieve all attendee registrations for a specific event using the event ID. This tool is designed for event organizers to view registration details.

Instructions

Get all registrations for an event. Only available to the event organizer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event

Implementation Reference

  • The core handler function for the 'get_event_registrations' tool. It retrieves the API client, fetches registrations for the given event ID, handles empty results and errors, formats the registrations using formatRegistration, and returns a formatted text response.
    async ({ event_id }) => {
      try {
        const apiClient = getClient();
        const registrations = await apiClient.getEventRegistrations(event_id);
        
        if (registrations.length === 0) {
          return {
            content: [{ type: 'text', text: 'No registrations found for this event.' }]
          };
        }
        
        const formatted = registrations.map(formatRegistration).join('\n\n---\n\n');
        return {
          content: [{ type: 'text', text: `Found ${registrations.length} registration(s):\n\n${formatted}` }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true
        };
      }
    }
  • Input schema definition using Zod, specifying 'event_id' as a required number with description.
    {
      event_id: z.number().describe('The ID of the event')
    },
  • src/index.ts:249-277 (registration)
    The server.tool() call that registers the 'get_event_registrations' tool with the MCP server, including name, description, input schema, and handler function.
    server.tool(
      'get_event_registrations',
      'Get all registrations for an event. Only available to the event organizer.',
      {
        event_id: z.number().describe('The ID of the event')
      },
      async ({ event_id }) => {
        try {
          const apiClient = getClient();
          const registrations = await apiClient.getEventRegistrations(event_id);
          
          if (registrations.length === 0) {
            return {
              content: [{ type: 'text', text: 'No registrations found for this event.' }]
            };
          }
          
          const formatted = registrations.map(formatRegistration).join('\n\n---\n\n');
          return {
            content: [{ type: 'text', text: `Found ${registrations.length} registration(s):\n\n${formatted}` }]
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true
          };
        }
      }
    );
  • API client helper method that performs the actual HTTP GET request to retrieve registrations for a specific event from the backend API.
    async getEventRegistrations(eventId: number): Promise<Registration[]> {
      try {
        const response: AxiosResponse<Registration[]> = await this.client.get(`/api/events/${eventId}/registrations/`);
        return response.data;
      } catch (error) {
        throw new Error(`Failed to get registrations for event ${eventId}: ${getErrorMessage(error)}`);
      }
    }
  • Utility function to format a single Registration object into a human-readable string, used in the tool handler to display results.
    function formatRegistration(reg: Registration): string {
      const eventInfo = typeof reg.event === 'object' ? reg.event.title : `Event ID: ${reg.event}`;
      const userInfo = typeof reg.user === 'object' ? reg.user.username : `User ID: ${reg.user}`;
      return `Registration (ID: ${reg.id})
      Event: ${eventInfo}
      User: ${userInfo}
      Status: ${reg.status}
      Registered at: ${reg.registered_at}`;
    }
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 of behavioral disclosure. It mentions access restrictions ('Only available to the event organizer'), which is useful. However, it lacks details on return format, pagination, error handling, or other behavioral traits, making it insufficient for a mutation-free but data-sensitive operation.

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 a single, efficient sentence with no wasted words. It is front-loaded with the core purpose and includes a key constraint, making it appropriately sized and structured for clarity.

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

Completeness3/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 minimal but covers the basic purpose and access restriction. For a tool with one parameter and 100% schema coverage, it is adequate but lacks details on return values or behavioral nuances, leaving room for improvement in completeness.

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%, with the single parameter 'event_id' documented in the schema. The description does not add any additional meaning or context beyond what the schema provides, such as format examples or constraints. Baseline 3 is appropriate as the schema handles the parameter documentation.

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 ('Get') and resource ('all registrations for an event'), making the purpose specific and understandable. However, it does not explicitly distinguish this tool from sibling tools like 'get_my_registrations' or 'manage_registration', which limits differentiation.

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

Usage Guidelines3/5

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

The description provides some context by stating 'Only available to the event organizer', which implies usage is restricted to organizers. However, it does not specify when to use this tool versus alternatives like 'get_my_registrations' or 'manage_registration', leaving gaps in guidance.

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