Skip to main content
Glama

send_formatted_message

Send formatted Slack messages using Block Kit to structure content with interactive elements in specified channels or threads.

Instructions

Send a message with Block Kit formatting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel ID
textYesFallback text
blocksYesBlock Kit blocks array
thread_tsNoOptional thread timestamp to reply to

Implementation Reference

  • The core handler function for the 'send_formatted_message' tool. It validates input using Zod schema, then uses the Slack client to post a message with Block Kit blocks support.
    export async function sendFormattedMessage(client: SlackClientWrapper, args: unknown) {
      const params = sendFormattedMessageSchema.parse(args);
    
      return await client.safeCall(async () => {
        const result = await client.getClient().chat.postMessage({
          channel: params.channel,
          text: params.text,
          blocks: params.blocks as any,
          thread_ts: params.thread_ts,
        });
    
        return {
          ok: true,
          channel: result.channel,
          ts: result.ts,
          message: result.message,
        };
      });
    }
  • Zod schema used for input validation in the handler, defining parameters: channel, text, blocks (array), optional thread_ts.
    export const sendFormattedMessageSchema = z.object({
      channel: channelIdSchema,
      text: z.string().min(1),
      blocks: blocksArraySchema,
      thread_ts: timestampSchema.optional(),
    });
  • src/index.ts:291-316 (registration)
    Tool metadata registration including name, description, and JSON inputSchema for the MCP list_tools endpoint.
    {
      name: 'send_formatted_message',
      description: 'Send a message with Block Kit formatting',
      inputSchema: {
        type: 'object',
        properties: {
          channel: {
            type: 'string',
            description: 'Channel ID',
          },
          text: {
            type: 'string',
            description: 'Fallback text',
          },
          blocks: {
            type: 'array',
            description: 'Block Kit blocks array',
          },
          thread_ts: {
            type: 'string',
            description: 'Optional thread timestamp to reply to',
          },
        },
        required: ['channel', 'text', 'blocks'],
      },
    },
  • src/index.ts:431-431 (registration)
    Binds the tool name to the imported handler function from messageTools for the MCP call_tool handler.
    send_formatted_message: (args) => messageTools.sendFormattedMessage(slackClient, args),
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions formatting but doesn't disclose critical behavioral traits like required permissions, rate limits, error conditions, whether messages are ephemeral or persistent, or what happens if formatting fails. This leaves significant gaps for a tool that sends messages.

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 is front-loaded with the core action and differentiator, making it easy to understand at a glance.

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 complexity of sending formatted messages and the lack of annotations and output schema, the description is insufficient. It doesn't cover behavioral aspects like success/failure responses, formatting rules, or integration with sibling tools, leaving the agent with incomplete context for proper 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 the schema already documents all parameters. The description adds no additional meaning about parameters beyond implying 'blocks' are for Block Kit formatting, which is redundant with the schema. Baseline 3 is appropriate as the 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 action ('Send a message') and the key differentiator ('with Block Kit formatting'), which distinguishes it from the simpler 'send_message' sibling tool. However, it doesn't specify the platform (e.g., Slack) or fully explain what Block Kit formatting entails beyond the name.

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?

The description implies usage when formatted messages are needed, but doesn't explicitly state when to use this versus 'send_message' (the sibling tool) or other messaging alternatives. No guidance is provided on prerequisites, limitations, or specific scenarios where Block Kit is preferred over plain text.

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/Hais/slack-bot-mcp'

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