list_destinations
Retrieve available data destinations from the Unstructured API. Filter results by connector type to find storage or database options for your data.
Instructions
List available destinations from the Unstructured API.
Args:
destination_type: Optional destination connector type to filter by
Returns:
String containing the list of destinations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| destination_type | No |
Implementation Reference
- uns_mcp/server.py:180-221 (handler)The handler function for the 'list_destinations' MCP tool. It lists available destination connectors from the Unstructured API, optionally filtered by destination_type. Registered via @mcp.tool() decorator.@mcp.tool() async def list_destinations( ctx: Context, destination_type: Optional[DestinationConnectorType | str] = None, ) -> str: """List available destinations from the Unstructured API. Args: destination_type: Optional destination connector type to filter by Returns: String containing the list of destinations """ client = ctx.request_context.lifespan_context.client request = ListDestinationsRequest() if destination_type: try: destination_type = ( DestinationConnectorType(destination_type) if isinstance(destination_type, str) else destination_type ) request.destination_type = destination_type except KeyError: return f"Invalid destination type: {destination_type}" response = await client.destinations.list_destinations_async(request=request) sorted_destinations = sorted( response.response_list_destinations, key=lambda dest: dest.name.lower(), ) if not sorted_destinations: return "No destinations found" result = ["Available destinations:"] for dest in sorted_destinations: result.append(f"- {dest.name} (ID: {dest.id})") return "\n".join(result)