Skip to main content
Glama
Sealjay

mcp-signal

list_groups

Retrieve Signal groups with group IDs, names, members, and admins. Use this to obtain group_id for sending messages.

Instructions

List Signal groups with group_id, name, description, members, and admin lists, sorted alphabetically.

Read-only with no side effects. Queries signal-cli when available; falls back to the local desktop database (without group_id). Use this to obtain group_id values needed by send_message. Use list_chats instead for a combined view of both direct and group chats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoCase-insensitive substring to filter group names. Empty string returns all groups.
limitNoMaximum number of groups to return, between 1 and 200.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main MCP tool handler for 'list_groups'. Decorated with @mcp.tool(). Accepts optional 'query' (case-insensitive substring filter) and 'limit' (1-200). Attempts signal_cli.list_groups() first, falls back to reader.list_local_groups() on SignalCLIError.
    @mcp.tool()
    def list_groups(
        query: Annotated[
            str,
            Field(
                description=(
                    "Case-insensitive substring to filter group"
                    " names. Empty string returns all groups."
                ),
            ),
        ] = "",
        limit: Annotated[
            int,
            Field(
                description=(
                    "Maximum number of groups to return,"
                    " between 1 and 200."
                ),
            ),
        ] = 50,
    ) -> list[dict[str, Any]]:
        """List Signal groups with group_id, name, description,
        members, and admin lists, sorted alphabetically.
    
        Read-only with no side effects. Queries signal-cli when
        available; falls back to the local desktop database (without
        group_id). Use this to obtain group_id values needed by
        send_message. Use list_chats instead for a combined view of
        both direct and group chats.
        """
        limit = min(max(limit, 1), _MAX_LIMIT)
        try:
            return signal_cli.list_groups(query=query, limit=limit)
        except SignalCLIError:
            return reader.list_local_groups(query=query, limit=limit)
  • Signal CLI back-end implementation. Calls signal-cli RPC method 'listGroups', filters by case-insensitive query substring, and returns dicts with group_id, name, description, members, admins, is_member, is_blocked. Sorted alphabetically by name.
    def list_groups(self, *, query: str = "", limit: int = 50) -> list[dict[str, Any]]:
        groups = self._rpc("listGroups") or []
        query_lower = query.strip().lower()
        rows = []
        for group in groups:
            name = group.get("name") or ""
            if query_lower and query_lower not in name.lower():
                continue
            rows.append(
                {
                    "group_id": group.get("id"),
                    "name": name,
                    "description": group.get("description") or "",
                    "members": group.get("members") or [],
                    "admins": group.get("admins") or [],
                    "is_member": group.get("isMember", True),
                    "is_blocked": group.get("isBlocked", False),
                }
            )
        rows.sort(key=lambda item: item["name"].lower())
        return rows[:limit]
  • Fallback implementation using the local desktop database. Filters list_chats() for groups only, sets group_id to None, and returns up to 'limit' results.
    def list_local_groups(self, query: str = "", limit: int = 50) -> list[dict[str, Any]]:
        groups = [chat for chat in self.list_chats(query=query, limit=10_000) if chat["is_group"]]
        for group in groups:
            group["group_id"] = None
        return groups[:limit]
  • Pydantic Field annotations for 'query' (optional str with description) and 'limit' (optional int with description, default 50). Used as Annotated type hints on the handler parameters.
        query: Annotated[
            str,
            Field(
                description=(
                    "Case-insensitive substring to filter group"
                    " names. Empty string returns all groups."
                ),
            ),
        ] = "",
        limit: Annotated[
            int,
            Field(
                description=(
                    "Maximum number of groups to return,"
                    " between 1 and 200."
                ),
            ),
        ] = 50,
    ) -> list[dict[str, Any]]:
Behavior4/5

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

With no annotations provided, the description carries full burden. It declares 'Read-only with no side effects' and explains the fallback from signal-cli to local desktop database (noting that group_id is missing in fallback). This is good but could be improved by mentioning any rate limits or error conditions.

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, each serving a distinct purpose: purpose and output fields, safety and fallback, usage guidance and sibling differentiation. No wasted words, and critical information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

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

The description covers all essential aspects: purpose, output fields, sorting, read-only safety, fallback behavior, when to use, and alternative tools. With an output schema available, return values are handled by schema. No gaps identified.

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?

Input schema has 100% description coverage and describes both parameters well. The description adds value by stating the output is sorted alphabetically, which is not in the schema. Baseline is 3; the sorting detail justifies a 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the verb ('List'), resource ('Signal groups'), and the specific fields returned (group_id, name, description, members, admin lists). Also distinguishes from sibling 'list_chats' by noting that list_chats provides a combined view of direct and group chats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use this tool: 'to obtain group_id values needed by send_message'. Also provides an alternative for a different use case: 'Use list_chats instead for a combined view'. Additionally, describes fallback behavior, giving clear context on data availability.

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/Sealjay/mcp-signal'

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