Skip to main content
Glama

create_embedded_editor_from_template

Generate an embedded editor for signing by converting templates or template groups into documents within the SignNow platform.

Instructions

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

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.
nameNoName 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 minutes (15-43200)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
editor_idYesID of the created embedded editor
editor_urlYesURL for the embedded editor
editor_entityYesType of editor entity: 'document' or 'document_group'
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 registration (@mcp.tool) and handler function. Authenticates via token provider and delegates to the core _create_embedded_editor_from_template helper.
        name="create_embedded_editor_from_template",
        description=(
            "Create document/group from template and create embedded editor immediately. "
            "This tool is ONLY for templates and template groups. "
            "If you have document or document_group, use the alternative tool: create_embedded_editor"
        ),
        tags=["template", "template_group", "document", "document_group", "embedded_editor", "embedded", "workflow"],
    )
    async def create_embedded_editor_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="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=15, le=43200, description="Optional link expiration in minutes (15-43200)")] = None,
    ) -> CreateEmbeddedEditorFromTemplateResponse:
        """Create document or document group from template and create embedded editor immediately.
    
        This tool is ONLY for templates and template groups.
        If you have document or document_group, use the alternative tool: create_embedded_editor
    
        This tool combines two operations:
        1. Creates a document/group from template using create_from_template
        2. Creates an embedded editor for the created entity using create_embedded_editor
    
        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 minutes (15-43200)
    
        Returns:
            CreateEmbeddedEditorFromTemplateResponse with created entity info and embedded editor details
        """
        token, client = _get_token_and_client(token_provider)
    
        # Initialize client and use the imported function from embedded_editor module
        return await _create_embedded_editor_from_template(entity_id, entity_type, name, redirect_uri, redirect_target, link_expiration, token, client, ctx)
  • Core helper function that implements the tool logic: creates a document or document group from a template, then creates an embedded editor for it, reporting progress via MCP context.
    async def _create_embedded_editor_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,
        token: str,
        client: SignNowAPIClient,
        ctx: Context,
    ) -> CreateEmbeddedEditorFromTemplateResponse:
        """Private function to create document/group from template and create embedded editor 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 minutes (15-43200)
            token: Access token for SignNow API
            client: SignNow API client instance
            ctx: FastMCP context for progress reporting
    
        Returns:
            CreateEmbeddedEditorFromTemplateResponse with created entity info and embedded editor 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":
            editor_response = _create_document_group_embedded_editor(client, token, created_entity.entity_id, redirect_uri, redirect_target, link_expiration)
            # Report final progress after embedded editor creation
            await ctx.report_progress(progress=3, total=3)
            return CreateEmbeddedEditorFromTemplateResponse(
                created_entity_id=created_entity.entity_id,
                created_entity_type=created_entity.entity_type,
                created_entity_name=created_entity.name,
                editor_id=editor_response.editor_url,
                editor_entity=editor_response.editor_entity,
                editor_url=editor_response.editor_url,
            )
        else:
            editor_response = _create_document_embedded_editor(client, token, created_entity.entity_id, redirect_uri, redirect_target, link_expiration)
            # Report final progress after embedded editor creation
            await ctx.report_progress(progress=3, total=3)
            return CreateEmbeddedEditorFromTemplateResponse(
                created_entity_id=created_entity.entity_id,
                created_entity_type=created_entity.entity_type,
                created_entity_name=created_entity.name,
                editor_id=editor_response.editor_url,
                editor_entity=editor_response.editor_entity,
                editor_url=editor_response.editor_url,
            )
  • Pydantic BaseModel defining the response schema for the create_embedded_editor_from_template tool.
    class CreateEmbeddedEditorFromTemplateResponse(BaseModel):
        """Response model for creating document/group from template and creating embedded editor 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")
        editor_id: str = Field(..., description="ID of the created embedded editor")
        editor_entity: str = Field(..., description="Type of editor entity: 'document' or 'document_group'")
        editor_url: str = Field(..., description="URL for the embedded editor")
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool creates something (implied mutation) and creates an embedded editor 'immediately', but doesn't disclose permission requirements, whether the creation is reversible, rate limits, or what the embedded editor entails. The description adds some context about the immediate creation but lacks comprehensive behavioral details for a mutation tool.

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 (two sentences) with zero waste. The first sentence states the purpose, the second provides crucial usage guidance. Every word earns its place, and the most important information (the restriction to templates) is front-loaded.

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 this is a mutation tool with no annotations but with a complete input schema (100% coverage) and an output schema exists, the description provides good purpose clarity and excellent usage guidelines. The main gap is behavioral transparency for a creation tool, but the existence of an output schema means the description doesn't need to explain return values. The description is appropriately complete for its role.

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 6 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema descriptions. It mentions templates/template groups which relates to entity_type, but this is already covered in the schema. 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 editor immediately') and explicitly distinguishes this tool from its sibling ('If you have document or document_group, use the alternative tool: create_embedded_editor'). It specifies the resource type (templates/template groups) and differentiates from the alternative for documents.

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 guidance: 'This tool is ONLY for templates and template groups' and names the alternative tool ('create_embedded_editor') for documents/document groups. This gives clear when-to-use and when-not-to-use criteria with a named alternative.

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