Skip to main content
Glama

list_contacts

Retrieve all Signal contacts with names and phone numbers. Filter by name or number substring to find specific contacts quickly.

Instructions

List all Signal contacts known to this account, including names and phone numbers. Use the optional search parameter to filter by name or number substring. Returns contacts from signal-cli's local contact store. Use get_profile to fetch the current Signal profile for a specific contact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoFilter contacts by name or number (case-insensitive substring match)

Implementation Reference

  • MCP tool handler for 'list_contacts' — calls client.list_contacts(search) and returns results as dicts
    elif name == "list_contacts":
        contacts = await client.list_contacts(search=arguments.get("search"))
        return _ok([c.to_dict() for c in contacts])
  • MCP Tool schema definition for 'list_contacts' with optional 'search' parameter for filtering by name or number substring
    Tool(
        name="list_contacts",
        description=(
            "List all Signal contacts known to this account, including names and phone numbers. "
            "Use the optional search parameter to filter by name or number substring. "
            "Returns contacts from signal-cli's local contact store. "
            "Use get_profile to fetch the current Signal profile for a specific contact."
        ),
        inputSchema={
            "type": "object",
            "properties": {
                "search": {"type": "string", "description": "Filter contacts by name or number (case-insensitive substring match)"},
            },
        },
    ),
  • SignalClient.list_contacts — core implementation that calls signal-cli JSON-RPC 'listContacts', parses results into Contact objects, optionally filters by search query (case-insensitive substring match on number, name, given_name, family_name)
    async def list_contacts(self, search: str | None = None) -> list[Contact]:
        result = await self._rpc("listContacts")
        contacts = []
        for c in result if isinstance(result, list) else []:
            profile = c.get("profile") or {}
            contacts.append(Contact(
                number=c.get("number") or "",
                uuid=c.get("uuid"),
                name=(c.get("name") or "").strip() or None,
                given_name=(profile.get("givenName") or c.get("givenName") or "").strip() or None,
                family_name=(profile.get("familyName") or c.get("familyName") or "").strip() or None,
                profile_name=None,
                about=(profile.get("about") or c.get("about") or "").strip() or None,
                blocked=c.get("isBlocked", False),
            ))
        if search:
            q = search.lower()
            contacts = [
                c for c in contacts
                if q in (c.number or "").lower()
                or q in (c.name or "").lower()
                or q in (c.given_name or "").lower()
                or q in (c.family_name or "").lower()
            ]
        return contacts
  • Contact dataclass with display_name property (prefers explicit name, then profile full name, then number) and to_dict() method
    @dataclass
    class Contact:
        number: str
        uuid: str | None = None
        name: str | None = None
        given_name: str | None = None
        family_name: str | None = None
        profile_name: str | None = None
        about: str | None = None
        blocked: bool = False
    
        @property
        def display_name(self) -> str:
            # Prefer explicit name set by user, then profile full name, then number
            if self.name and self.name.strip():
                return self.name.strip()
            parts = " ".join(filter(None, [self.given_name, self.family_name])).strip()
            if parts:
                return parts
            return self.profile_name or self.number or ""
    
        def to_dict(self) -> dict:
            return {
                "number": self.number,
                "uuid": self.uuid,
                "name": self.name,
                "given_name": self.given_name,
                "family_name": self.family_name,
                "profile_name": self.profile_name,
                "about": self.about,
                "blocked": self.blocked,
                "display_name": self.display_name,
            }
  • Tool registration via MCP's @app.list_tools() decorator which returns the TOOLS list containing list_contacts
    @app.list_tools()
    async def list_tools() -> list[Tool]:
        return TOOLS
Behavior3/5

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

No annotations provided, so description must fully disclose behavior. It mentions 'local contact store' but omits details like pagination, ordering, or maximum results. The tool is read-only, which is implied but not explicitly stated.

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 short sentences: purpose and output, optional usage, and alternative tool. No redundant information.

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?

For a simple list tool with one optional parameter and no output schema, the description is fully adequate. It covers functionality, usage, and relational context (alternative tool).

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 coverage is 100%; the description restates the search parameter's function as 'filter by name or number substring' without adding extra meaning beyond the schema's description.

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?

The description clearly states 'List all Signal contacts known to this account, including names and phone numbers.' It identifies the specific verb (list), resource (contacts), and output content, distinguishing itself from sibling tools like get_profile.

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

Usage Guidelines4/5

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

Provides clear context: optional search parameter for filtering and explicit alternative (get_profile) for fetching a specific contact's profile. However, no explicit when-not-to-use guidance is given.

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

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