Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

update_s3_source

Modify an S3 source connector in the Unstructured API MCP Server by updating the S3 URI, enabling or disabling recursive folder access, and retrieving updated connector details.

Instructions

Update an S3 source connector.

Args: source_id: ID of the source connector to update remote_url: The S3 URI to the bucket or folder recursive: Whether to access subfolders within the bucket Returns: String containing the updated source connector information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recursiveNo
remote_urlNo
source_idYes

Implementation Reference

  • The core asynchronous handler function that implements the logic for the 'update_s3_source' tool. It retrieves the current S3 source configuration, applies the provided updates to remote_url and/or recursive parameters, and calls the Unstructured API to update the source connector.
    async def update_s3_source( ctx: Context, source_id: str, remote_url: Optional[str] = None, recursive: Optional[bool] = None, ) -> str: """Update an S3 source connector. Args: source_id: ID of the source connector to update remote_url: The S3 URI to the bucket or folder recursive: Whether to access subfolders within the bucket Returns: String containing the updated source connector information """ client = ctx.request_context.lifespan_context.client # Get the current source connector configuration try: get_response = await client.sources.get_source_async( request=GetSourceRequest(source_id=source_id), ) current_config = get_response.source_connector_information.config except Exception as e: return f"Error retrieving source connector: {str(e)}" # Update configuration with new values config = dict(current_config) if remote_url is not None: config["remote_url"] = remote_url if recursive is not None: config["recursive"] = recursive source_connector = UpdateSourceConnector(config=config) try: response = await client.sources.update_source_async( request=UpdateSourceRequest( source_id=source_id, update_source_connector=source_connector, ), ) result = create_log_for_created_updated_connector( response, connector_name="S3", connector_type="Source", created_or_updated="Updated", ) return result except Exception as e: return f"Error updating S3 source connector: {str(e)}"
  • Registration of the update_s3_source handler in the dispatch dictionary (update_functions) for source_type='s3' within the 'update_source_connector' MCP tool.
    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, }
  • Documentation in the 'update_source_connector' tool docstring specifying the input schema for S3 source updates: optional remote_url (str) and recursive (bool).
    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:

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