Skip to main content
Glama

create_embedded_editor

Generate an embedded editor to modify documents or document groups within SignNow's e-signature platform. Specify the document ID and optional parameters for customization.

Instructions

Create embedded editor for editing 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: create_embedded_editor_from_template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_idYesID of the document or document group
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.
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_urlYesURL for the embedded editor
editor_entityYesType of editor entity: 'document' or 'document_group'

Implementation Reference

  • The MCP tool handler function for 'create_embedded_editor'. It handles authentication, parameter validation via type hints, and delegates to the core _create_embedded_editor helper.
        name="create_embedded_editor",
        description=(
            "Create embedded editor for editing 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: create_embedded_editor_from_template"
        ),
        tags=["edit", "document", "document_group", "embedded"],
    )
    def create_embedded_editor(
        ctx: Context,
        entity_id: Annotated[str, Field(description="ID of the document or document group")],
        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,
        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,
    ) -> CreateEmbeddedEditorResponse:
        """Create embedded editor for editing 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: create_embedded_editor_from_template
    
        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.
            redirect_uri: Optional redirect URI for the editor link
            redirect_target: Optional redirect target for the editor link
            link_expiration: Optional number of minutes for the editor link to expire (15-43200)
    
        Returns:
            CreateEmbeddedEditorResponse with editor ID and entity type
        """
        token, client = _get_token_and_client(token_provider)
    
        return _create_embedded_editor(entity_id, entity_type, redirect_uri, redirect_target, link_expiration, token, client)
  • The @mcp.tool decorator registers this function as the 'create_embedded_editor' tool on the FastMCP server instance.
        name="create_embedded_editor",
        description=(
            "Create embedded editor for editing 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: create_embedded_editor_from_template"
        ),
        tags=["edit", "document", "document_group", "embedded"],
    )
    def create_embedded_editor(
        ctx: Context,
        entity_id: Annotated[str, Field(description="ID of the document or document group")],
        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,
        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,
    ) -> CreateEmbeddedEditorResponse:
        """Create embedded editor for editing 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: create_embedded_editor_from_template
    
        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.
            redirect_uri: Optional redirect URI for the editor link
            redirect_target: Optional redirect target for the editor link
            link_expiration: Optional number of minutes for the editor link to expire (15-43200)
    
        Returns:
            CreateEmbeddedEditorResponse with editor ID and entity type
        """
        token, client = _get_token_and_client(token_provider)
    
        return _create_embedded_editor(entity_id, entity_type, redirect_uri, redirect_target, link_expiration, token, client)
  • Core helper implementing the embedded editor creation logic: auto-detects entity type (document or document_group), calls specific API methods via SignNow client, and returns formatted response.
    def _create_embedded_editor(
        entity_id: str,
        entity_type: Literal["document", "document_group"] | None,
        redirect_uri: str | None,
        redirect_target: str | None,
        link_expiration: int | None,
        token: str,
        client: SignNowAPIClient,
    ) -> CreateEmbeddedEditorResponse:
        """Private function to create embedded editor for editing 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.
            redirect_uri: Optional redirect URI for the editor link
            redirect_target: Optional redirect target for the editor link
            link_expiration: Optional number of minutes for the editor link to expire (15-43200)
            token: Access token for SignNow API
            client: SignNow API client instance
    
        Returns:
            CreateEmbeddedEditorResponse with editor 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":
            # Create document group embedded editor
            # 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 _create_document_group_embedded_editor(client, token, entity_id, redirect_uri, redirect_target, link_expiration)
        else:
            # Create document embedded editor
            return _create_document_embedded_editor(client, token, entity_id, redirect_uri, redirect_target, link_expiration)
  • Pydantic model defining the output schema for the create_embedded_editor tool response.
    class CreateEmbeddedEditorResponse(BaseModel):
        """Response model for creating 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 the full burden of behavioral disclosure. It states this creates an embedded editor for editing, which implies a write/mutation operation, but doesn't disclose important behavioral aspects like required permissions, whether this generates a shareable link, what the embedded editor interface looks like, or any rate limits. The description adds some context about the entity types but lacks comprehensive behavioral transparency for a creation 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 perfectly concise and well-structured in just two sentences. The first sentence states the core purpose, and the second sentence provides crucial exclusion guidance. Every word earns its place with zero redundancy or unnecessary elaboration. This is an excellent example of efficient communication.

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 handles return values), no annotations, and 100% schema description coverage, the description does a good job of covering the essential context. It clearly defines the tool's purpose and scope while differentiating from alternatives. However, for a creation tool with no annotations, it could benefit from mentioning what the embedded editor actually does or what permissions might be required, keeping it from a perfect score.

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?

The schema description coverage is 100%, meaning all parameters are well-documented in the schema itself. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions. It mentions 'document or document group' which relates to entity_type, but this is already covered in the schema. With complete schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding beyond the structured data.

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 embedded editor') and the target resources ('for editing a document or document group'). It explicitly distinguishes this tool from its sibling 'create_embedded_editor_from_template' by stating 'This tool is ONLY for documents and document groups' and naming the alternative for templates. This provides excellent differentiation and specificity.

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 versus alternatives: 'This tool is ONLY for documents and document groups. If you have template or template_group, use the alternative tool: create_embedded_editor_from_template'. This clearly defines the scope and names the specific alternative tool, giving the agent perfect decision-making guidance.

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