update_s3_destination
Modify the S3 destination connector by updating its ID and remote URL, enabling accurate data storage and retrieval within the Unstructured API MCP Server.
Instructions
Update an S3 destination connector.
Args:
destination_id: ID of the destination connector to update
remote_url: The S3 URI to the bucket or folder
Returns:
String containing the updated destination connector information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destination_id | Yes | ||
| recursive | No | ||
| remote_url | No |
Implementation Reference
- The handler function that executes the core logic for updating an S3 destination connector by fetching current config, applying updates, and calling the API.async def update_s3_destination( ctx: Context, destination_id: str, remote_url: Optional[str] = None, recursive: Optional[bool] = None, ) -> str: """Update an S3 destination connector. Args: destination_id: ID of the destination connector to update remote_url: The S3 URI to the bucket or folder Returns: String containing the updated destination connector information """ client = ctx.request_context.lifespan_context.client # Get the current destination connector configuration try: get_response = await client.destinations.get_destination_async( request=GetDestinationRequest(destination_id=destination_id), ) current_config = get_response.destination_connector_information.config except Exception as e: return f"Error retrieving destination 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 destination_connector = UpdateDestinationConnector(config=config) try: response = await client.destinations.update_destination_async( request=UpdateDestinationRequest( destination_id=destination_id, update_destination_connector=destination_connector, ), ) result = create_log_for_created_updated_connector( response, connector_name="S3", connector_type="Destination", created_or_updated="Updated", ) return result except Exception as e: return f"Error updating S3 destination connector: {str(e)}"
- uns_mcp/connectors/destination/destination_tool.py:200-209 (registration)Registration of the update_s3_destination handler in the dispatcher dictionary for update_destination_connector tool.update_functions = { "astradb": update_astradb_destination, "databricks_delta_table": update_databricks_delta_table_destination, "databricks_volumes": update_databricks_volumes_destination, "mongodb": update_mongodb_destination, "neo4j": update_neo4j_destination, "pinecone": update_pinecone_destination, "s3": update_s3_destination, "weaviate": update_weaviate_destination, }
- Import of the update_s3_destination function for use in the destination tools.from uns_mcp.connectors.destination.s3 import ( create_s3_destination, update_s3_destination, )
- uns_mcp/connectors/destination/__init__.py:10-15 (registration)MCP tool registration for the higher-level update_destination_connector which dispatches to update_s3_destination.def register_destination_connectors(mcp: FastMCP): """Register all destination connector tools with the MCP server.""" mcp.tool()(create_destination_connector) mcp.tool()(update_destination_connector) mcp.tool()(delete_destination_connector)