Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

create_source_connector

Create connectors to extract data from cloud platforms like Azure, Google Drive, OneDrive, Salesforce, S3, and SharePoint for processing with the Unstructured API.

Instructions

Create a source connector based on type. Args: ctx: Context object with the request and lifespan context name: A unique name for this connector source_type: The type of source being created (e.g., 'azure', 'onedrive', 'salesforce', 'gdrive', 's3', 'sharepoint')

    type_specific_config:
        azure:
            remote_url: The Azure Storage remote URL with the format
                        az://<container-name>/<path/to/file/or/folder/in/container/as/needed>
            recursive: (Optional[bool]) Whether to access subfolders
        gdrive:
            drive_id: The Drive ID for the Google Drive source
            recursive: (Optional[bool]) Whether to access subfolders
            extensions: (Optional[list[str]]) File extensions to filter
        onedrive:
            path: The path to the target folder in the OneDrive account
            user_pname: The User Principal Name (UPN) for the OneDrive user account
            recursive: (Optional[bool]) Whether to access subfolders
            authority_url: (Optional[str]) The authentication token provider URL
        s3:
            remote_url: The S3 URI to the bucket or folder (e.g., s3://my-bucket/)
            recursive: (Optional[bool]) Whether to access subfolders
        salesforce:
            username: The Salesforce username
            categories: (Optional[list[str]]) Optional Salesforce domain,the names of the
                        Salesforce categories (objects) that you want to access, specified as
                        a comma-separated list. Available categories include Account, Campaign,
                        Case, EmailMessage, and Lead.
        sharepoint:
            site: The SharePoint site to connect to
            user_pname: The username for the SharePoint site
            path: (Optional) The path within the SharePoint site
            recursive: (Optional[bool]) Whether to access subfolders
            authority_url: (Optional[str]) The authority URL for authentication

Returns:
    String containing the created source connector information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
source_typeYes
type_specific_configYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that implements the logic for the 'create_source_connector' tool. It routes to specific connector creation functions based on the source_type.
    async def create_source_connector(
        ctx: Context,
        name: str,
        source_type: Literal["azure", "onedrive", "salesforce", "gdrive", "s3", "sharepoint"],
        type_specific_config: dict[str, Any],
    ) -> str:
        """Create a source connector based on type.
        Args:
            ctx: Context object with the request and lifespan context
            name: A unique name for this connector
            source_type: The type of source being created (e.g., 'azure', 'onedrive',
                         'salesforce', 'gdrive', 's3', 'sharepoint')
    
            type_specific_config:
                azure:
                    remote_url: The Azure Storage remote URL with the format
                                az://<container-name>/<path/to/file/or/folder/in/container/as/needed>
                    recursive: (Optional[bool]) Whether to access subfolders
                gdrive:
                    drive_id: The Drive ID for the Google Drive source
                    recursive: (Optional[bool]) Whether to access subfolders
                    extensions: (Optional[list[str]]) File extensions to filter
                onedrive:
                    path: The path to the target folder in the OneDrive account
                    user_pname: The User Principal Name (UPN) for the OneDrive user account
                    recursive: (Optional[bool]) Whether to access subfolders
                    authority_url: (Optional[str]) The authentication token provider URL
                s3:
                    remote_url: The S3 URI to the bucket or folder (e.g., s3://my-bucket/)
                    recursive: (Optional[bool]) Whether to access subfolders
                salesforce:
                    username: The Salesforce username
                    categories: (Optional[list[str]]) Optional Salesforce domain,the names of the
                                Salesforce categories (objects) that you want to access, specified as
                                a comma-separated list. Available categories include Account, Campaign,
                                Case, EmailMessage, and Lead.
                sharepoint:
                    site: The SharePoint site to connect to
                    user_pname: The username for the SharePoint site
                    path: (Optional) The path within the SharePoint site
                    recursive: (Optional[bool]) Whether to access subfolders
                    authority_url: (Optional[str]) The authority URL for authentication
    
        Returns:
            String containing the created source connector information
        """
        source_functions = {
            "azure": create_azure_source,
            "gdrive": create_gdrive_source,
            "onedrive": create_onedrive_source,
            "s3": create_s3_source,
            "salesforce": create_salesforce_source,
            "sharepoint": create_sharepoint_source,
        }
    
        if source_type in source_functions:
            source_function = source_functions[source_type]
            return await source_function(ctx=ctx, name=name, **type_specific_config)
    
        return (
            f"Unsupported source type: {source_type}. "
            f"Please use a supported source type: {list(source_functions.keys())}."
        )
  • Registration of the 'create_source_connector' tool (along with related tools) using the mcp.tool() decorator in the register_source_connectors function.
    def register_source_connectors(mcp: FastMCP):
        """Register all source connector tools with the MCP server."""
    
        mcp.tool()(create_source_connector)
        mcp.tool()(update_source_connector)
        mcp.tool()(delete_source_connector)
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. It clearly indicates this is a creation/mutation operation ('Create a source connector'), which implies it's not read-only. However, it doesn't disclose important behavioral aspects like authentication requirements, error conditions, idempotency, or what happens if a connector with the same name already exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately structured with clear sections (Args, Returns) and uses bullet points for readability. While detailed, every sentence provides necessary information about parameters. The front-loaded purpose statement is clear, though the parameter documentation is extensive.

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 complexity (3 parameters with nested objects, 0% schema coverage, no annotations), the description does an excellent job explaining parameters. With an output schema present, it doesn't need to detail return values. However, it lacks context about the broader system (what connectors are used for, prerequisites) and behavioral constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description provides extensive parameter documentation that fully compensates. It explains all 3 parameters in detail, including the complex 'type_specific_config' with comprehensive examples for each source type variant. This adds significant value beyond the bare schema.

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 tool creates a source connector based on type, which is a specific verb+resource combination. It distinguishes itself from siblings like 'create_destination_connector' by focusing on source connectors. However, it doesn't explicitly differentiate from 'update_source_connector' in terms of when to create vs update.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_source_connector' or 'get_source_info'. It mentions creating based on type but doesn't specify prerequisites, constraints, or when this operation is appropriate versus other source-related operations.

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/Unstructured-IO/UNS-MCP'

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