Skip to main content
Glama

list_direct_messages

Retrieve all messages from a 1:1 room in Cisco Webex by specifying a parent ID, person ID, or email. Enables efficient message tracking and management.

Instructions

List all messages in a 1:1 room.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentIdYesThe parent ID to filter messages.
personEmailYesThe person email to filter messages in a 1:1 room.
personIdYesThe person ID to filter messages in a 1:1 room.

Implementation Reference

  • The handler function that executes the tool logic: constructs Webex API URL for /messages/direct with parameters and fetches the list of direct messages.
    const executeFunction = async ({ parentId, personId, personEmail }) => {
    
      try {
        // Construct the URL with query parameters
        const url = new URL(getWebexUrl('/messages/direct'));
        url.searchParams.append('parentId', parentId);
    
        // Add either personId OR personEmail, not both
        if (personId) {
          url.searchParams.append('personId', personId);
        } else if (personEmail) {
          url.searchParams.append('personEmail', personEmail);
        }
    
        // 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(JSON.stringify(errorData));
        }
    
        // Parse and return the response data
        const data = await response.json();
        return data;
      } catch (error) {
        console.error('Error listing direct messages:', error);
        return {
          error: error.message || 'An error occurred while listing direct messages.',
          details: error.stack
        };
      }
    };
  • JSON Schema defining the input parameters for the tool: parentId (required filter), personId or personEmail (optional for 1:1 room).
    parameters: {
      type: 'object',
      properties: {
        parentId: {
          type: 'string',
          description: 'The parent ID to filter messages.'
        },
        personId: {
          type: 'string',
          description: 'The person ID to filter messages in a 1:1 room.'
        },
        personEmail: {
          type: 'string',
          description: 'The person email to filter messages in a 1:1 room.'
        }
      },
      required: []
    }
  • Tool registration object 'apiTool' that binds the handler to the schema definition with name 'list_direct_messages' and exports it.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'list_direct_messages',
          description: 'List all messages in a 1:1 room.',
          parameters: {
            type: 'object',
            properties: {
              parentId: {
                type: 'string',
                description: 'The parent ID to filter messages.'
              },
              personId: {
                type: 'string',
                description: 'The person ID to filter messages in a 1:1 room.'
              },
              personEmail: {
                type: 'string',
                description: 'The person email to filter messages in a 1:1 room.'
              }
            },
            required: []
          }
        }
      }
    };
  • The tool file path listed in toolPaths array, likely used for dynamic loading of Webex messaging tools.
    'webex-public-workspace/webex-messaging/list-direct-messages.js',
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 action ('List all messages') but lacks behavioral details such as pagination, rate limits, authentication requirements, or what 'all' entails (e.g., time range, limit). This is a significant gap for a tool with no annotation coverage.

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 zero waste. It's front-loaded with the core action and context, making it easy to parse quickly without unnecessary elaboration.

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 behavioral context (e.g., how results are returned, limits) and doesn't compensate for the missing structured data. For a tool with three required parameters and list functionality, more detail is needed to guide effective use.

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 parameters are fully documented in the schema. The description adds no additional meaning beyond implying filtering for '1:1 room', which aligns with schema parameters but doesn't enhance understanding. 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 1:1 room'), making the purpose unambiguous. However, it doesn't explicitly distinguish this tool from its sibling 'list_messages', which might handle different types of rooms or have different filtering capabilities, preventing a perfect score.

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_messages' or other filtering tools. It mentions '1:1 room' context but doesn't specify prerequisites, exclusions, or comparative use cases with siblings, leaving the agent to infer usage.

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