Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

send_message

Send messages directly to Google Chat spaces using the tool within the Google Workspace MCP Server. Specify user details, space ID, and message text for effective communication.

Instructions

Sends a message to a Google Chat space.

Returns:
    str: Confirmation message with sent message details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_textYes
serviceYes
space_idYes
thread_keyNo
user_google_emailYes

Implementation Reference

  • The core handler function `send_message` that sends a text message to a specified Google Chat space using the Google Chat API service. It supports optional thread_key for threaded replies and returns a confirmation with message ID and timestamp.
    async def send_message(
        service,
        user_google_email: str,
        space_id: str,
        message_text: str,
        thread_key: Optional[str] = None
    ) -> str:
        """
        Sends a message to a Google Chat space.
    
        Returns:
            str: Confirmation message with sent message details.
        """
        logger.info(f"[send_message] Email: '{user_google_email}', Space: '{space_id}'")
    
        message_body = {
            'text': message_text
        }
    
        # Add thread key if provided (for threaded replies)
        request_params = {
            'parent': space_id,
            'body': message_body
        }
        if thread_key:
            request_params['threadKey'] = thread_key
    
        message = await asyncio.to_thread(
            service.spaces().messages().create(**request_params).execute
        )
    
        message_name = message.get('name', '')
        create_time = message.get('createTime', '')
    
        msg = f"Message sent to space '{space_id}' by {user_google_email}. Message ID: {message_name}, Time: {create_time}"
        logger.info(f"Successfully sent message to space '{space_id}' by {user_google_email}")
        return msg
  • Registers the `send_message` tool in the MCP server registry using the `@server.tool()` decorator.
    @server.tool()
  • Input schema defined by function parameters: service (inferred), user_google_email: str, space_id: str, message_text: str, thread_key: Optional[str] = None. Output: str confirmation.
    async def send_message(
        service,
        user_google_email: str,
        space_id: str,
        message_text: str,
        thread_key: Optional[str] = None
    ) -> str:
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 mentions a return value ('Confirmation message with sent message details'), which adds some context beyond the basic action. However, it lacks critical details like authentication requirements, rate limits, error conditions, or whether the operation is idempotent—significant gaps for a tool that performs a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded with the core purpose in the first sentence. The second sentence about returns is useful but could be integrated more seamlessly. Overall, it avoids unnecessary verbosity, though slight structural improvements could enhance clarity.

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 5 parameters, 0% schema coverage, no annotations, and no output schema, the description is insufficient. It covers the basic action and return hint but omits parameter explanations, behavioral nuances, and differentiation from siblings. Given the complexity and lack of structured support, more comprehensive guidance is needed.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but fails to do so. It provides no information about the 5 parameters (e.g., what 'service' refers to, how 'space_id' is obtained, the purpose of 'thread_key'), leaving them entirely undocumented. This is inadequate given the parameter count and coverage gap.

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 ('sends a message') and target resource ('to a Google Chat space'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'send_gmail_message' or 'get_messages', which would require explicit comparison to achieve 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?

No guidance is provided on when to use this tool versus alternatives like 'send_gmail_message' or 'search_messages'. The description only states what it does without context about appropriate scenarios or prerequisites, 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/taylorwilsdon/google_workspace_mcp'

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