Skip to main content
Glama
larrygmaguire-hash

Slack Note Capture MCP Server

slack_read_messages

Retrieve Slack channel messages from recent days or specific timestamps to access captured content from your inbox.

Instructions

Read messages from a Slack channel. Returns messages from the last N days or since a specific timestamp. Use this to pull captured content from the inbox.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idNoThe Slack channel ID. Defaults to configured inbox channel.
days_backNoNumber of days of history to fetch. Default is 7.
oldestNoUnix timestamp. If provided, only messages after this time are returned.
limitNoMaximum number of messages to return. Default 100.

Implementation Reference

  • Handler logic for 'slack_read_messages' tool, which fetches Slack conversation history using the Slack Web API.
    case "slack_read_messages": {
      const channelId = args.channel_id || DEFAULT_CHANNEL;
      const daysBack = args.days_back || 7;
      const limit = args.limit || 100;
    
      if (!channelId) {
        return {
          content: [
            {
              type: "text",
              text: "Error: No channel ID provided and no default channel configured.",
            },
          ],
        };
      }
    
      // Calculate oldest timestamp
      const oldest =
        args.oldest ||
        String(Math.floor(Date.now() / 1000) - daysBack * 24 * 60 * 60);
    
      const result = await slack.conversations.history({
        channel: channelId,
        oldest: oldest,
        limit: limit,
        inclusive: true,
      });
    
      const messages = result.messages || [];
    
      // Format messages with files info
      const formattedMessages = messages.map((msg) => {
        let formatted = {
          ts: msg.ts,
          text: msg.text,
          user: msg.user,
          date: new Date(parseFloat(msg.ts) * 1000).toISOString(),
          thread_ts: msg.thread_ts,
          reply_count: msg.reply_count || 0,
        };
    
        if (msg.files && msg.files.length > 0) {
          formatted.files = msg.files.map((f) => ({
            id: f.id,
            name: f.name,
            mimetype: f.mimetype,
            size: f.size,
            url_private: f.url_private,
          }));
        }
    
        return formatted;
      });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                channel: channelId,
                message_count: formattedMessages.length,
                messages: formattedMessages.reverse(), // Chronological order
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/index.js:67-96 (registration)
    Definition and schema registration for the 'slack_read_messages' tool.
    {
      name: "slack_read_messages",
      description:
        "Read messages from a Slack channel. Returns messages from the last N days or since a specific timestamp. Use this to pull captured content from the inbox.",
      inputSchema: {
        type: "object",
        properties: {
          channel_id: {
            type: "string",
            description:
              "The Slack channel ID. Defaults to configured inbox channel.",
          },
          days_back: {
            type: "number",
            description:
              "Number of days of history to fetch. Default is 7.",
          },
          oldest: {
            type: "string",
            description:
              "Unix timestamp. If provided, only messages after this time are returned.",
          },
          limit: {
            type: "number",
            description: "Maximum number of messages to return. Default 100.",
          },
        },
        required: [],
      },
    },
Behavior3/5

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

No annotations provided, so description carries full burden. Explains temporal filtering behavior ('last N days or since a specific timestamp') and default values (7 days, 100 messages). However, lacks disclosure of read-only safety, rate limits, pagination cursors, or the structure/format of returned message objects.

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?

Three sentences with zero waste: first establishes purpose, second explains filtering behavior, third provides use-case context. Every sentence earns its place with no redundancy.

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?

No output schema exists, yet description only states 'Returns messages' without detailing structure, fields, or format. With 4 optional parameters and numerous sibling tools, the description adequately covers inputs but leaves significant gaps on output expectations and behavioral edge cases (e.g., conflict resolution if both days_back and oldest are provided).

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?

Schema coverage is 100% (baseline 3). Description adds valuable semantic context by grouping 'days_back' and 'oldest' as alternative time filters ('or'), and explains 'channel_id' defaults to 'configured inbox channel'—context not present in the schema descriptions.

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?

Clear verb ('Read') and resource ('messages from a Slack channel'). Effectively distinguishes from sibling 'slack_read_thread' by specifying 'channel' versus 'thread', and from 'slack_search_messages' by describing a direct retrieval pattern rather than query-based search.

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?

Provides specific usage context ('Use this to pull captured content from the inbox'), but lacks explicit guidance on when to prefer this over 'slack_search_messages' or 'slack_read_thread', and does not mention exclusion criteria or prerequisites like channel membership.

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/larrygmaguire-hash/slack-note-capture'

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