Skip to main content
Glama
fabian1710

MCP Intercom Server

by fabian1710

list-conversations-from-last-week

Retrieve recent Intercom conversations from the past 7 days to review customer interactions and support activity.

Instructions

Fetch all conversations from the last week (last 7 days)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of the tool: calculates timestamps for the past 7 days and searches conversations using createdAt > startTimestamp and updatedAt < endTimestamp via IntercomClient.
    export async function listConversationsFromLastWeek() {
      // Calculate last week's date range
      const client = new IntercomClient();
      const now = new Date();
      const lastWeekStart = new Date(now);
      lastWeekStart.setDate(now.getDate() - 7);
      lastWeekStart.setHours(0, 0, 0, 0);
    
      const lastWeekEnd = new Date(lastWeekStart);
      lastWeekEnd.setDate(lastWeekStart.getDate() + 6);
      lastWeekEnd.setHours(23, 59, 59, 999);
    
      // Convert to Unix timestamp (seconds)
      const startTimestamp = Math.floor(lastWeekStart.getTime() / 1000);
      const endTimestamp = Math.floor(lastWeekEnd.getTime() / 1000);
    
      return client.searchConversations({
        createdAt: {
          operator: ">",
          value: startTimestamp,
        },
        updatedAt: {
          operator: "<",
          value: endTimestamp,
        },
      });
    }
  • src/index.ts:24-28 (registration)
    Tool registration in MCP server capabilities, defining name, description, input schema (empty object), and output schema.
    "list-conversations-from-last-week": {
      description: "Fetch all conversations from the last week (last 7 days)",
      inputSchema: z.object({}),
      outputSchema: z.any(),
    },
  • Dispatch logic in CallToolRequest handler that calls the listConversationsFromLastWeek function and formats the response as MCP content or error.
    if (name === "list-conversations-from-last-week") {
      try {
        const conversations = await listConversationsFromLastWeek();
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(conversations, null, 2),
            },
          ],
        };
      } catch (error) {
        if (error instanceof Error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error.message}`,
              },
            ],
          };
        }
        throw error;
      }
    }
  • src/index.ts:93-99 (registration)
    Tool listed in the ListTools response with name, description, and input schema.
      name: "list-conversations-from-last-week",
      description: "Fetch all conversations from the last week (last 7 days)",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the action ('fetch') but doesn't specify whether this is a read-only operation, if it requires authentication, how results are returned (e.g., pagination, format), or any rate limits. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 front-loads the core functionality ('fetch all conversations from the last week') with a clarifying parenthetical ('last 7 days'). There is zero wasted text, 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.

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate as a minimum viable explanation. It covers the basic purpose but lacks details on behavioral traits and usage context, which are needed for full completeness, especially with a sibling tool available. This results in a baseline score of 3.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add parameter details, and the baseline for 0 parameters is 4, as it avoids unnecessary repetition while being clear about the tool's scope (time-based fetching).

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 ('fetch') and resource ('conversations') with a specific time constraint ('from the last week (last 7 days)'), making the purpose unambiguous. However, it doesn't explicitly differentiate from the sibling tool 'search-conversations', which likely offers more flexible filtering options, 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 the sibling 'search-conversations', nor does it mention any prerequisites, exclusions, or alternative scenarios. It simply states what the tool does without contextual usage advice, leaving the agent to infer when this specific time-bound fetch is appropriate.

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/fabian1710/mcp-intercom'

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