Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

update_source_connector

Modify configuration settings for cloud storage and business application connectors to adjust data access parameters.

Instructions

Update a source connector based on type.

Args:
    ctx: Context object with the request and lifespan context
    source_id: ID of the source connector to update
    source_type: The type of source being updated (e.g., 'azure', 'onedrive',
                 'salesforce', 'gdrive', 's3', 'sharepoint')

    type_specific_config:
        azure:
            remote_url: (Optional[str]) 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: (Optional[str]) 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: (Optional[str]) The path to the target folder in the OneDrive account
            user_pname: (Optional[str]) 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: (Optional[str]) The S3 URI to the bucket or folder
                        (e.g., s3://my-bucket/)
            recursive: (Optional[bool]) Whether to access subfolders
        salesforce:
            username: (Optional[str]) 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: Optional([str]) The SharePoint site to connect to
            user_pname: Optional([str]) 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 updated source connector information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYes
source_typeYes
type_specific_configYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'update_source_connector' MCP tool. It takes source_id, source_type, and type_specific_config, dispatches to the appropriate type-specific update function (imported from individual connector modules), and returns a status message. Includes detailed docstring serving as input schema documentation.
    async def update_source_connector(
        ctx: Context,
        source_id: str,
        source_type: Literal["azure", "onedrive", "salesforce", "gdrive", "s3", "sharepoint"],
        type_specific_config: dict[str, Any],
    ) -> str:
        """Update a source connector based on type.
    
        Args:
            ctx: Context object with the request and lifespan context
            source_id: ID of the source connector to update
            source_type: The type of source being updated (e.g., 'azure', 'onedrive',
                         'salesforce', 'gdrive', 's3', 'sharepoint')
    
            type_specific_config:
                azure:
                    remote_url: (Optional[str]) 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: (Optional[str]) 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: (Optional[str]) The path to the target folder in the OneDrive account
                    user_pname: (Optional[str]) 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: (Optional[str]) The S3 URI to the bucket or folder
                                (e.g., s3://my-bucket/)
                    recursive: (Optional[bool]) Whether to access subfolders
                salesforce:
                    username: (Optional[str]) 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: Optional([str]) The SharePoint site to connect to
                    user_pname: Optional([str]) 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 updated source connector information
        """
    
        update_functions = {
            "azure": update_azure_source,
            "gdrive": update_gdrive_source,
            "onedrive": update_onedrive_source,
            "s3": update_s3_source,
            "salesforce": update_salesforce_source,
            "sharepoint": update_sharepoint_source,
        }
    
        if source_type in update_functions:
            update_function = update_functions[source_type]
            return await update_function(ctx=ctx, source_id=source_id, **type_specific_config)
    
        return (
            f"Unsupported source type: {source_type}. "
            f"Please use a supported source type: {list(update_functions.keys())}."
        )
  • Registration of the 'update_source_connector' tool (along with related create/delete tools) using FastMCP's mcp.tool() decorator within the register_source_connectors function.
    mcp.tool()(create_source_connector)
    mcp.tool()(update_source_connector)
    mcp.tool()(delete_source_connector)
  • Type hints and comprehensive docstring in the handler function define the input schema, including parameters and type-specific configuration options for each supported source_type.
    async def update_source_connector(
        ctx: Context,
        source_id: str,
        source_type: Literal["azure", "onedrive", "salesforce", "gdrive", "s3", "sharepoint"],
        type_specific_config: dict[str, Any],
    ) -> str:
        """Update a source connector based on type.
    
        Args:
            ctx: Context object with the request and lifespan context
            source_id: ID of the source connector to update
            source_type: The type of source being updated (e.g., 'azure', 'onedrive',
                         'salesforce', 'gdrive', 's3', 'sharepoint')
    
            type_specific_config:
                azure:
                    remote_url: (Optional[str]) 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: (Optional[str]) 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: (Optional[str]) The path to the target folder in the OneDrive account
                    user_pname: (Optional[str]) 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: (Optional[str]) The S3 URI to the bucket or folder
                                (e.g., s3://my-bucket/)
                    recursive: (Optional[bool]) Whether to access subfolders
                salesforce:
                    username: (Optional[str]) 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: Optional([str]) The SharePoint site to connect to
                    user_pname: Optional([str]) 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 updated source connector information
        """
    
        update_functions = {
            "azure": update_azure_source,
            "gdrive": update_gdrive_source,
            "onedrive": update_onedrive_source,
            "s3": update_s3_source,
            "salesforce": update_salesforce_source,
            "sharepoint": update_sharepoint_source,
        }
    
        if source_type in update_functions:
            update_function = update_functions[source_type]
            return await update_function(ctx=ctx, source_id=source_id, **type_specific_config)
    
        return (
            f"Unsupported source type: {source_type}. "
            f"Please use a supported source type: {list(update_functions.keys())}."
        )
Behavior2/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 mentions the tool updates a connector but doesn't specify required permissions, whether changes are reversible, rate limits, or error handling. The return value is briefly noted but lacks detail on format or potential errors. For a mutation tool with zero annotation coverage, this is insufficient.

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

Conciseness3/5

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

The description is front-loaded with the tool's purpose but becomes verbose with detailed parameter explanations. While the parameter details are valuable, the structure could be more efficient—e.g., using a bulleted list. Some sentences are lengthy, but overall, it avoids unnecessary fluff and stays focused on functionality.

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 (3 parameters with nested objects, no annotations, but an output schema exists), the description is reasonably complete. It covers parameter semantics thoroughly and notes the return value. However, it lacks behavioral context like permissions or error handling, which is a gap for a mutation tool, though the output schema mitigates some completeness needs.

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?

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains 'source_type' with examples (e.g., 'azure', 'onedrive') and details 'type_specific_config' with optional parameters for each type, including data formats and purposes. This compensates fully for the schema's lack of descriptions, making parameters understandable.

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 updates a source connector based on type, providing a specific verb ('update') and resource ('source connector'). It distinguishes from siblings like 'create_source_connector' and 'delete_source_connector' by focusing on modification rather than creation or deletion. However, it doesn't explicitly contrast with 'update_destination_connector' or 'update_workflow'.

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. It doesn't mention prerequisites (e.g., needing an existing source connector), compare with sibling tools like 'create_source_connector' for initial setup, or specify scenarios where updates are appropriate versus deletion and recreation. Usage is implied but not explicitly stated.

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