Skip to main content
Glama

list_events

Retrieve and filter events within your organization using the Webex Messaging API. Specify parameters like resource type, actor ID, date range, and maximum results to customize the output.

Instructions

List events in your organization using the Webex Messaging API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actorIdYesThe ID of the actor to filter events.
fromYesThe start date to filter events.
maxNoThe maximum number of events to return.
resourceNoThe resource type to filter events.
toYesThe end date to filter events.
typeNoThe type of events to list.

Implementation Reference

  • Handler function that executes the list_events tool by constructing a Webex API request to /events with provided filters and returning the response data or error.
    const executeFunction = async ({ resource = 'messages', type = 'created', actorId, from, to, max = 100 }) => {
    
      try {
        // Construct the URL with query parameters
        const url = new URL(getWebexUrl('/events'));
        url.searchParams.append('resource', resource);
        url.searchParams.append('type', type);
        url.searchParams.append('actorId', actorId);
        url.searchParams.append('from', from);
        url.searchParams.append('to', to);
        url.searchParams.append('max', max.toString());
    
        // Set up headers for the request
        const headers = getWebexHeaders();
    
        // Perform the fetch request
        const response = await fetch(url.toString(), {
          method: 'GET',
          headers
        });
    
        // Check if the response was successful
        if (!response.ok) {
          const errorData = await response.json();
          throw new Error(errorData);
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        console.error('Error listing events:', error);
        return { error: 'An error occurred while listing events.' };
      }
    };
  • Tool definition including name 'list_events', description, and JSON schema for input parameters with required fields actorId, from, to.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'list_events',
          description: 'List events in your organization using the Webex Messaging API.',
          parameters: {
            type: 'object',
            properties: {
              resource: {
                type: 'string',
                description: 'The resource type to filter events.'
              },
              type: {
                type: 'string',
                description: 'The type of events to list.'
              },
              actorId: {
                type: 'string',
                description: 'The ID of the actor to filter events.'
              },
              from: {
                type: 'string',
                description: 'The start date to filter events.'
              },
              to: {
                type: 'string',
                description: 'The end date to filter events.'
              },
              max: {
                type: 'integer',
                description: 'The maximum number of events to return.'
              }
            },
            required: ['actorId', 'from', 'to']
          }
        }
      }
    };
  • lib/tools.js:7-16 (registration)
    Dynamic registration of all tools, including list_events, by importing modules listed in toolPaths and spreading their apiTool objects.
    export async function discoverTools() {
      const toolPromises = toolPaths.map(async (file) => {
        const module = await import(`../tools/${file}`);
        return {
          ...module.apiTool,
          path: file,
        };
      });
      return Promise.all(toolPromises);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool lists events but doesn't disclose behavioral traits such as pagination, rate limits, authentication requirements, or what 'events' encompass (e.g., message events, meeting events). This leaves significant gaps for an agent to understand how to use it effectively.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the tool's complexity (6 parameters, 3 required) and lack of annotations and output schema, the description is insufficient. It doesn't explain what 'events' are, how results are returned, or any behavioral aspects, leaving the agent with incomplete context for proper invocation.

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 all 6 parameters. The description adds no additional meaning beyond the schema, such as examples or constraints on values like 'resource' or 'type'. This meets the baseline of 3 when schema coverage is high.

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 action ('List events') and specifies the resource ('events in your organization') and API source ('using the Webex Messaging API'), making the purpose unambiguous. However, it doesn't differentiate this tool from sibling tools like 'get_event_details' or other list tools, which would require a 5.

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 sibling tools like 'get_event_details' for single events or other list tools for different resources, nor does it specify any prerequisites or contextual cues for selection.

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

Related 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/Kashyap-AI-ML-Solutions/webex-messaging-mcp-server'

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