Skip to main content
Glama
mikemc
by mikemc

twist_threads_mute

Mute a Twist thread temporarily by specifying its ID and duration in minutes to reduce notifications.

Instructions

Mutes a thread for a number of minutes.

Args: id: The id of the thread minutes: The number of minutes to mute the thread

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
minutesYes

Implementation Reference

  • Handler function that executes the tool logic: mutes a specified thread for a given number of minutes by making a POST request to the Twist API 'threads/mute' endpoint.
    def twist_threads_mute(
        ctx: Context,
        id: int,
        minutes: int
    ) -> Union[str, Dict[str, Any]]:
        """Mutes a thread for a number of minutes.
    
        Args:
            id: The id of the thread
            minutes: The number of minutes to mute the thread
        """
        all_params = locals()
        token = ctx.request_context.lifespan_context.twist_token
        params = {k: v for k, v in all_params.items() if k != 'ctx' and v is not None}
    
        try:
            logger.info(f"Muting thread with ID: {id} for {minutes} minutes")
            thread_data = twist_request("threads/mute", params=params, token=token, method="POST")
            logger.info(f"Successfully muted thread with ID: {id}")
            return thread_data
        except Exception as error:
            logger.error(f"Error muting thread: {error}")
            return f"Error muting thread: {str(error)}"
  • main.py:42-48 (registration)
    Dynamic registration loop that registers all functions starting with 'twist_' from src.inbox and src.threads modules as MCP tools, including twist_threads_mute.
    # Register all tools from tool modules
    for module in [src.inbox, src.threads]:
        for name, func in inspect.getmembers(module, inspect.isfunction):
            if name.startswith('twist_') and func.__module__ == module.__name__:
                logger.info(f"Registering tool: {name}")
                mcp.tool()(func)

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/mikemc/twist-mcp-server'

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