Skip to main content
Glama

send_invite

Send signing invitations for documents or document groups to recipients with defined roles and actions.

Instructions

Send invite to sign a document or document group. This tool is ONLY for documents and document groups. If you have template or template_group, use the alternative tool: send_invite_from_template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYesID of the document or document group
ordersNoList of orders with recipients (can be a list or JSON string)
entity_typeNoType of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
invite_idYesID of the created invite
invite_entityYesType of invite entity: 'document' or 'document_group'

Implementation Reference

  • The primary handler function for the 'send_invite' MCP tool. It handles input normalization, retrieves authentication token and client, and delegates to the _send_invite helper function to execute the core logic.
        name="send_invite",
        description=(
            "Send invite to sign a document or document group. "
            "This tool is ONLY for documents and document groups. "
            "If you have template or template_group, use the alternative tool: send_invite_from_template"
        ),
        tags=["send_invite", "document", "document_group", "sign", "workflow"],
    )
    def send_invite(
        ctx: Context,
        entity_id: Annotated[str, Field(description="ID of the document or document group")],
        orders: Annotated[
            list[InviteOrder] | str | None,
            Field(
                description="List of orders with recipients (can be a list or JSON string)",
                examples=[
                    [{"order": 1, "recipients": [{"email": "user@example.com", "role": "Signer 1", "action": "sign"}]}],
                    '[{"order": 1, "recipients": [{"email": "user@example.com", "role": "Signer 1", "action": "sign"}]}]',
                ],
            ),
        ] = None,
        entity_type: Annotated[
            Literal["document", "document_group"] | None,
            Field(description="Type of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type."),
        ] = None,
    ) -> SendInviteResponse:
        """Send invite to sign a document or document group.
    
        This tool is ONLY for documents and document groups.
        If you have template or template_group, use the alternative tool: send_invite_from_template
    
        Args:
            entity_id: ID of the document or document group
            orders: List of orders with recipients (can be a list or JSON string)
            entity_type: Type of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type.
    
        Returns:
            SendInviteResponse with invite ID and entity type
        """
        token, client = _get_token_and_client(token_provider)
    
        # Normalize orders parameter (handle JSON string input)
        normalized_orders = _normalize_orders(orders, InviteOrder)
    
        # Initialize client and use the imported function from send_invite module
        return _send_invite(entity_id, entity_type, normalized_orders, token, client)
  • The @mcp.tool decorator that registers the 'send_invite' tool with FastMCP, including name, description, tags, and input parameters.
        name="send_invite",
        description=(
            "Send invite to sign a document or document group. "
            "This tool is ONLY for documents and document groups. "
            "If you have template or template_group, use the alternative tool: send_invite_from_template"
        ),
        tags=["send_invite", "document", "document_group", "sign", "workflow"],
    )
    def send_invite(
        ctx: Context,
        entity_id: Annotated[str, Field(description="ID of the document or document group")],
        orders: Annotated[
            list[InviteOrder] | str | None,
            Field(
                description="List of orders with recipients (can be a list or JSON string)",
                examples=[
                    [{"order": 1, "recipients": [{"email": "user@example.com", "role": "Signer 1", "action": "sign"}]}],
                    '[{"order": 1, "recipients": [{"email": "user@example.com", "role": "Signer 1", "action": "sign"}]}]',
                ],
            ),
        ] = None,
        entity_type: Annotated[
            Literal["document", "document_group"] | None,
            Field(description="Type of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type."),
        ] = None,
    ) -> SendInviteResponse:
        """Send invite to sign a document or document group.
    
        This tool is ONLY for documents and document groups.
        If you have template or template_group, use the alternative tool: send_invite_from_template
    
        Args:
            entity_id: ID of the document or document group
            orders: List of orders with recipients (can be a list or JSON string)
            entity_type: Type of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type.
    
        Returns:
            SendInviteResponse with invite ID and entity type
        """
        token, client = _get_token_and_client(token_provider)
    
        # Normalize orders parameter (handle JSON string input)
        normalized_orders = _normalize_orders(orders, InviteOrder)
    
        # Initialize client and use the imported function from send_invite module
        return _send_invite(entity_id, entity_type, normalized_orders, token, client)
  • Pydantic model for the response of the send_invite tool.
    class SendInviteResponse(BaseModel):
        """Response model for sending invite."""
    
        invite_id: str = Field(..., description="ID of the created invite")
        invite_entity: str = Field(..., description="Type of invite entity: 'document' or 'document_group'")
  • Pydantic model for invite orders used as input to send_invite.
    class InviteOrder(BaseModel):
        """Order information for invite."""
    
        order: int = Field(..., description="Order number for this step")
        recipients: list[InviteRecipient] = Field(..., description="List of recipients for this order")
  • Core helper function implementing the send invite logic, including entity type detection, and delegating to document-specific or document group-specific invite functions.
    def _send_invite(entity_id: str, entity_type: Literal["document", "document_group"] | None, orders: list[InviteOrder], token: str, client: SignNowAPIClient) -> SendInviteResponse:
        """Private function to send invite to sign a document or document group.
    
        Args:
            entity_id: ID of the document or document group
            entity_type: Type of entity: 'document' or 'document_group' (optional). If you're passing it, make sure you know what type you have. If it's not found, try using a different type.
            orders: List of orders with recipients
            token: Access token for SignNow API
            client: SignNow API client instance
    
        Returns:
            SendInviteResponse with invite ID and entity type
        """
    
        # Determine entity type if not provided
        document_group = None  # Store document group if found during auto-detection
    
        if not entity_type:
            # Try to determine entity type by attempting to get document group first (higher priority)
            try:
                document_group = client.get_document_group(token, entity_id)
                entity_type = "document_group"
            except Exception:
                # If document group not found, try document
                try:
                    client.get_document(token, entity_id)
                    entity_type = "document"
                except Exception:
                    raise ValueError(f"Entity with ID {entity_id} not found as either document group or document") from None
    
        if entity_type == "document_group":
            # Send document group field invite
            # Get the document group if we don't have it yet
            if not document_group:
                document_group = client.get_document_group(token, entity_id)
    
            return _send_document_group_field_invite(client, token, entity_id, orders, document_group)
        else:
            # Send document field invite
            return _send_document_field_invite(client, token, entity_id, orders)
Behavior2/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 of behavioral disclosure. While it mentions the tool sends invites, it doesn't describe what happens after sending (e.g., whether invites are queued, sent immediately, what permissions are required, or what the response looks like). For a mutation tool with zero annotation coverage, this is a significant gap in behavioral context.

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 efficient - just two sentences that each earn their place. The first sentence states the core purpose, and the second provides crucial usage guidance. There's zero waste or redundancy, making it easy for an agent to parse quickly.

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 there's an output schema (which means the description doesn't need to explain return values), the description covers the essential context well. It clearly defines the tool's scope and provides critical sibling differentiation. However, for a mutation tool with no annotations, it could benefit from more behavioral context about what the tool actually does beyond 'send invite'.

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 already documents all three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. According to the scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the 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 the specific action ('send invite') and the resource ('to sign a document or document group'), making the purpose immediately understandable. It explicitly distinguishes this tool from its sibling 'send_invite_from_template' by specifying it's ONLY for documents and document groups, providing excellent sibling differentiation.

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 ('ONLY for documents and document groups') and when to use an alternative ('If you have template or template_group, use the alternative tool: send_invite_from_template'). This gives the agent clear decision criteria for tool selection.

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