Skip to main content
Glama

list_document_groups

Retrieve a paginated list of document groups with basic details from SignNow for e-signature workflows.

Instructions

Get simplified list of document groups with basic information.

Note: If your client supports MCP Resources, prefer the resource version of this endpoint; this tool exists as a compatibility fallback for tool-only clients.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of document groups to return (default: 50, max: 50)
offsetNoNumber of document groups to skip for pagination (default: 0)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_groupsYes
document_group_total_countYesTotal number of document groups

Implementation Reference

  • Primary MCP tool handler for 'list_document_groups'. Includes @mcp.tool registration decorator, input parameter schemas with validation, and delegation to implementation.
    @mcp.tool(name="list_document_groups", description="Get simplified list of document groups with basic information." + TOOL_FALLBACK_SUFFIX, tags=["document_group", "list"])
    def list_document_groups(
        ctx: Context,
        limit: Annotated[int, Field(ge=1, le=50, description="Maximum number of document groups to return (default: 50, max: 50)")] = 50,
        offset: Annotated[int, Field(ge=0, description="Number of document groups to skip for pagination (default: 0)")] = 0,
    ) -> SimplifiedDocumentGroupsResponse:
        """Provide simplified list of document groups with basic fields.
    
        Args:
            limit: Maximum number of document groups to return (default: 50, max: 50)
            offset: Number of document groups to skip for pagination (default: 0)
        """
        return _list_document_groups_impl(ctx, limit, offset)
  • Core helper function implementing the logic to fetch document groups via SignNow API client and simplify the response into MCP-compatible models.
    def _list_document_groups(token: str, client: SignNowAPIClient, limit: int = 50, offset: int = 0) -> SimplifiedDocumentGroupsResponse:
        """Provide simplified list of document groups with basic fields.
    
        Args:
            token: Access token for SignNow API
            signnow_config: SignNow configuration object
            limit: Maximum number of document groups to return (default: 50, max: 50)
            offset: Number of document groups to skip for pagination (default: 0)
    
        Returns:
            SimplifiedDocumentGroupsResponse with document groups
        """
        # Use the client to get document groups - API already applies limit and offset
        full_response = client.get_document_groups(token, limit=limit, offset=offset)
    
        # Convert to simplified models for MCP tools
        simplified_groups = []
        for group in full_response.document_groups:
            simplified_docs = []
            for doc in group.documents:
                # Use document_name if available, otherwise fallback to document ID
                document_name = doc.document_name if doc.document_name is not None else doc.id
                simplified_doc = SimplifiedDocumentGroupDocument(id=doc.id, name=document_name, roles=doc.roles)
                simplified_docs.append(simplified_doc)
    
            simplified_group = SimplifiedDocumentGroup(
                last_updated=group.last_updated,
                group_id=group.group_id,
                group_name=group.group_name,
                invite_id=group.invite_id,
                invite_status=group.invite_status,
                documents=simplified_docs,
            )
            simplified_groups.append(simplified_group)
    
        # Use the total count from API response, not the length of current page
        return SimplifiedDocumentGroupsResponse(document_groups=simplified_groups, document_group_total_count=full_response.document_group_total_count)
  • Pydantic model defining the output schema for the list_document_groups tool.
    class SimplifiedDocumentGroupsResponse(BaseModel):
        """Simplified response for MCP tools with document groups"""
    
        document_groups: list[SimplifiedDocumentGroup]
        document_group_total_count: int = Field(..., description="Total number of document groups")
  • Pydantic model for simplified document group structure used in the tool response.
    class SimplifiedDocumentGroup(BaseModel):
        """Simplified document group for MCP tools."""
    
        last_updated: int = Field(..., description="Unix timestamp of the last update")
        group_id: str = Field(..., description="Document group ID")
        group_name: str = Field(..., description="Name of the document group")
        invite_id: str | None = Field(None, description="Invite ID for this group")
        invite_status: str | None = Field(None, description="Status of the invite (e.g., 'pending')")
        documents: list[SimplifiedDocumentGroupDocument] = Field(..., description="List of documents in this group")
  • Intermediate helper that obtains auth token/client and calls the core list_documents helper.
    def _list_document_groups_impl(ctx: Context, limit: int = 50, offset: int = 0) -> SimplifiedDocumentGroupsResponse:
        token, client = _get_token_and_client(token_provider)
        return _list_document_groups(token, client, limit, offset)
Behavior3/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 the tool is a 'compatibility fallback' which adds useful context about its role, but doesn't disclose behavioral traits like rate limits, authentication requirements, error conditions, or what 'simplified list' and 'basic information' specifically entail beyond what the output schema might provide.

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 extremely concise with two sentences that each serve a clear purpose: the first states the tool's function, and the second provides critical usage guidance. There's no wasted text, and information is front-loaded appropriately.

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

Completeness4/5

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

Given that this is a read-only list operation with 2 parameters (fully documented in schema), an output schema exists, and no annotations are needed for safety, the description is reasonably complete. It explains the tool's purpose and when to use it, though it could benefit from clarifying what 'simplified' and 'basic information' mean relative to a potential resource version.

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 fully documents both parameters (limit and offset). The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 for high schema coverage.

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 ('Get simplified list') and resource ('document groups'), specifying it provides 'basic information'. However, it doesn't differentiate from potential sibling list operations (none exist in the sibling tools list, but the distinction isn't explicit).

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?

The description provides explicit guidance on when to use this tool vs. alternatives: 'If your client supports MCP Resources, prefer the resource version of this endpoint; this tool exists as a compatibility fallback for tool-only clients.' This clearly defines the primary use case and alternative approach.

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/signnow/sn-mcp-server'

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