Skip to main content
Glama

list_messages

Retrieve messages from a Webex room by room ID, filter by parent message, mentioned people, date, or message ID, and set a response limit.

Instructions

List messages in a Webex room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
beforeNoList messages sent before a specific date and time.
beforeMessageNoList messages sent before a specific message, by ID.
maxNoLimit the maximum number of messages in the response.
mentionedPeopleNoList messages with these people mentioned, by ID.
parentIdNoThe ID of the parent message to filter by.
roomIdYesThe ID of the room to list messages from.

Implementation Reference

  • The main handler function `executeFunction` that lists messages from a Webex room using the Webex API.
    const executeFunction = async ({ roomId, parentId, mentionedPeople, before, beforeMessage, max = 100 }) => {
      try {
        // Construct the URL with query parameters
        const url = new URL(getWebexUrl('/messages'));
        url.searchParams.append('roomId', roomId);
        if (parentId) url.searchParams.append('parentId', parentId);
        if (mentionedPeople) url.searchParams.append('mentionedPeople', mentionedPeople);
        if (before) url.searchParams.append('before', before);
        if (beforeMessage) url.searchParams.append('beforeMessage', beforeMessage);
        url.searchParams.append('max', max.toString());
    
        // Get headers using centralized config
        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(JSON.stringify(errorData));
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        console.error('Error listing messages:', error);
        return {
          error: error.message || 'An error occurred while listing messages.',
          details: error.stack
        };
      }
    };
  • The `apiTool` configuration defining the tool schema, name, description, and input parameters for 'list_messages'.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'list_messages',
          description: 'List messages in a Webex room.',
          parameters: {
            type: 'object',
            properties: {
              roomId: {
                type: 'string',
                description: 'The ID of the room to list messages from.'
              },
              parentId: {
                type: 'string',
                description: 'The ID of the parent message to filter by.'
              },
              mentionedPeople: {
                type: 'string',
                description: 'List messages with these people mentioned, by ID.'
              },
              before: {
                type: 'string',
                description: 'List messages sent before a specific date and time.'
              },
              beforeMessage: {
                type: 'string',
                description: 'List messages sent before a specific message, by ID.'
              },
              max: {
                type: 'integer',
                description: 'Limit the maximum number of messages in the response.'
              }
            },
            required: ['roomId']
          }
        }
      }
    };
  • lib/tools.js:7-16 (registration)
    The `discoverTools` function that dynamically loads and registers the `apiTool` from list-messages.js and other tool files.
    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);
    }
  • tools/paths.js:51-51 (registration)
    The path to list-messages.js is listed in the `toolPaths` array used by discoverTools for registration.
    'webex-public-workspace/webex-messaging/list-messages.js',
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It doesn't disclose whether this is a read-only operation (implied by 'List'), pagination behavior, rate limits, authentication requirements, or what the response format looks like. 'List messages' suggests a retrieval operation, but no details about ordering, limits, or error conditions are provided.

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, clear sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function. Every word earns its place in this minimal but complete statement of function.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't address what the tool returns, how results are structured, pagination behavior, or error handling. While the schema documents parameters well, the overall context for using this tool effectively is missing.

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?

The input schema has 100% description coverage, so parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain parameter relationships, constraints, or usage patterns. Baseline 3 is appropriate when 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 ('messages in a Webex room'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_direct_messages' or 'get_message_details', which would require specifying this is for room messages specifically (though implied by 'roomId' parameter).

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 like 'list_direct_messages' or 'get_message_details'. It doesn't mention prerequisites (like needing room access) or typical use cases. The only implied context is having a roomId, but this isn't explicitly stated.

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