Skip to main content
Glama

create_embedded_sending_from_template

Generate documents from templates and initiate embedded signing workflows for e-signature collection.

Instructions

Create document/group from template and create embedded sending immediately. This tool is ONLY for templates and template groups. If you have document or document_group, use the alternative tool: create_embedded_sending

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYesID of the template or template group
entity_typeNoType of entity: 'template' or 'template_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.
nameNoOptional name for the new document or document group
redirect_uriNoOptional redirect URI after completion
redirect_targetNoOptional redirect target: 'self' (default), 'blank'
link_expirationNoOptional link expiration in days (14-45)
typeNoType of sending step: 'manage', 'edit', or 'send-invite'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sending_idYesID of the created embedded sending
sending_urlYesURL for the embedded sending
sending_entityYesType of sending entity: 'document', 'document_group', or 'invite'
created_entity_idYesID of the created document or document group
created_entity_nameYesName of the created entity
created_entity_typeYesType of created entity: 'document' or 'document_group'

Implementation Reference

  • MCP tool handler and registration for create_embedded_sending_from_template. Thin wrapper that authenticates and delegates to core helper.
    @mcp.tool(
        name="create_embedded_sending_from_template",
        description=(
            "Create document/group from template and create embedded sending immediately. "
            "This tool is ONLY for templates and template groups. "
            "If you have document or document_group, use the alternative tool: create_embedded_sending"
        ),
        tags=["template", "template_group", "document", "document_group", "send_invite", "embedded", "workflow"],
    )
    async def create_embedded_sending_from_template(
        ctx: Context,
        entity_id: Annotated[str, Field(description="ID of the template or template group")],
        entity_type: Annotated[
            Literal["template", "template_group"] | None,
            Field(description="Type of entity: 'template' or 'template_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,
        name: Annotated[str | None, Field(description="Optional name for the new document or document group")] = None,
        redirect_uri: Annotated[str | None, Field(description="Optional redirect URI after completion")] = None,
        redirect_target: Annotated[str | None, Field(description="Optional redirect target: 'self' (default), 'blank'")] = None,
        link_expiration: Annotated[int | None, Field(ge=14, le=45, description="Optional link expiration in days (14-45)")] = None,
        type: Annotated[Literal["manage", "edit", "send-invite"] | None, Field(description="Type of sending step: 'manage', 'edit', or 'send-invite'")] = None,
    ) -> CreateEmbeddedSendingFromTemplateResponse:
        """Create document or document group from template and create embedded sending immediately.
    
        This tool is ONLY for templates and template groups.
        If you have document or document_group, use the alternative tool: create_embedded_sending
    
        This tool combines two operations:
        1. Creates a document/group from template using create_from_template
        2. Creates an embedded sending for the created entity using create_embedded_sending
    
        Args:
            entity_id: ID of the template or template group
            entity_type: Type of entity: 'template' or 'template_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.
            name: Optional name for the new document or document group
            redirect_uri: Optional redirect URI after completion
            redirect_target: Optional redirect target: 'self', 'blank', or 'self' (default)
            link_expiration: Optional link expiration in days (14-45)
            type: Type of sending step: 'manage', 'edit', or 'send-invite'
    
        Returns:
            CreateEmbeddedSendingFromTemplateResponse with created entity info and embedded sending details
        """
        token, client = _get_token_and_client(token_provider)
    
        return await _create_embedded_sending_from_template(entity_id, entity_type, name, redirect_uri, redirect_target, link_expiration, type, token, client, ctx)
  • Core helper function implementing the logic: create document/group from template, then create embedded sending link with progress reporting.
    async def _create_embedded_sending_from_template(
        entity_id: str,
        entity_type: Literal["template", "template_group"] | None,
        name: str | None,
        redirect_uri: str | None,
        redirect_target: str | None,
        link_expiration: int | None,
        sending_type: str | None,
        token: str,
        client: SignNowAPIClient,
        ctx: Context,
    ) -> CreateEmbeddedSendingFromTemplateResponse:
        """Private function to create document/group from template and create embedded sending immediately.
    
        Args:
            entity_id: ID of the template or template group
            entity_type: Type of entity: 'template' or 'template_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.
            name: Optional name for the new document or document group
            redirect_uri: Optional redirect URI after completion
            redirect_target: Optional redirect target: 'self', 'blank', or 'self' (default)
            link_expiration: Optional link expiration in days (14-45)
            sending_type: Type of sending step: 'manage', 'edit', or 'send-invite'
            token: Access token for SignNow API
            client: SignNow API client instance
            ctx: FastMCP context for progress reporting
    
        Returns:
            CreateEmbeddedSendingFromTemplateResponse with created entity info and embedded sending details
        """
        # Report initial progress
        await ctx.report_progress(progress=1, total=3)
    
        # Import and use the create from template function directly
        from .create_from_template import _create_from_template
    
        # Use the imported function to create from template
        created_entity = _create_from_template(entity_id, entity_type, name, token, client)
    
        # Report progress after template creation
        await ctx.report_progress(progress=2, total=3)
    
        if created_entity.entity_type == "document_group":
            sending_response = _create_document_group_embedded_sending(client, token, created_entity.entity_id, redirect_uri, redirect_target, link_expiration, sending_type)
            # Report final progress after embedded sending creation
            await ctx.report_progress(progress=3, total=3)
            return CreateEmbeddedSendingFromTemplateResponse(
                created_entity_id=created_entity.entity_id,
                created_entity_type=created_entity.entity_type,
                created_entity_name=created_entity.name,
                sending_id=sending_response.sending_url,
                sending_entity=sending_response.sending_entity,
                sending_url=sending_response.sending_url,
            )
        else:
            # Create document embedded sending
            sending_response = _create_document_embedded_sending(client, token, created_entity.entity_id, redirect_uri, redirect_target, link_expiration, sending_type)
            # Report final progress after embedded sending creation
            await ctx.report_progress(progress=3, total=3)
            return CreateEmbeddedSendingFromTemplateResponse(
                created_entity_id=created_entity.entity_id,
                created_entity_type=created_entity.entity_type,
                created_entity_name=created_entity.name,
                sending_id=sending_response.sending_url,
                sending_entity=sending_response.sending_entity,
                sending_url=sending_response.sending_url,
            )
  • Pydantic input schema for the tool request parameters.
    class CreateEmbeddedSendingFromTemplateRequest(BaseModel):
        """Request model for creating document/group from template and creating embedded sending immediately."""
    
        entity_id: str = Field(..., description="ID of the template or template group")
        entity_type: str | None = Field(None, description="Type of entity: 'template' or 'template_group' (optional)")
        name: str | None = Field(None, description="Optional name for the new document or document group")
        redirect_uri: str | None = Field(None, description="Optional redirect URI after completion")
        redirect_target: str | None = Field(None, description="Optional redirect target: 'self', 'blank', or 'self' (default)")
        link_expiration: int | None = Field(None, ge=14, le=45, description="Optional link expiration in days (14-45)")
        type: str | None = Field(None, description="Type of sending step: 'manage', 'edit', or 'send-invite'")
    
        def model_dump(self, **kwargs: Any) -> dict[str, Any]:
            """Override model_dump to exclude redirect_target if redirect_uri is not provided."""
            data = super().model_dump(**kwargs)
            if (not self.redirect_uri or not self.redirect_uri.strip()) and "redirect_target" in data:
                del data["redirect_target"]
            return data
  • Pydantic output schema for the tool response.
    class CreateEmbeddedSendingFromTemplateResponse(BaseModel):
        """Response model for creating document/group from template and creating embedded sending immediately."""
    
        created_entity_id: str = Field(..., description="ID of the created document or document group")
        created_entity_type: str = Field(..., description="Type of created entity: 'document' or 'document_group'")
        created_entity_name: str = Field(..., description="Name of the created entity")
        sending_id: str = Field(..., description="ID of the created embedded sending")
        sending_entity: str = Field(..., description="Type of sending entity: 'document', 'document_group', or 'invite'")
        sending_url: str = Field(..., description="URL for the embedded sending")
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 describes the core behavior (create from template + embedded sending) but lacks details about permissions required, whether this is a destructive operation, rate limits, or what the embedded sending entails. The description doesn't contradict any annotations, but provides only basic behavioral context for a complex multi-step operation.

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 perfectly concise with two sentences: one stating the purpose and one providing usage guidelines. Every word earns its place, and the most important information (what it does and when to use it) is front-loaded. No wasted words or redundancy.

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 the tool's complexity (7 parameters, multi-step operation) and the presence of an output schema (which handles return values), the description covers the essential context well. It clearly defines the tool's purpose and usage boundaries. However, for a tool with no annotations and significant behavioral implications, more transparency about permissions, side effects, or the embedded sending process would improve completeness.

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 7 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. It mentions templates/template groups which relates to entity_type, but doesn't provide additional semantic context. Baseline 3 is appropriate when schema does the heavy lifting.

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: 'Create document/group from template and create embedded sending immediately.' It distinguishes from sibling tools by specifying 'ONLY for templates and template groups' and naming the alternative 'create_embedded_sending' for documents/document groups. This provides precise verb+resource+scope 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 usage guidelines: 'This tool is ONLY for templates and template groups. If you have document or document_group, use the alternative tool: create_embedded_sending.' This clearly defines when to use this tool versus alternatives, including both inclusion criteria (templates/template groups) and exclusion criteria (documents/document groups).

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