list_destinations
Retrieve a list of available destinations from the Unstructured API, optionally filtered by connector type, to manage data flow and integration points.
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 implementing the logic for the 'list_destinations' tool. It uses the UnstructuredClient to fetch destinations, optionally filters by type, sorts them alphabetically by name, and returns a formatted list as a string.@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)
- uns_mcp/server.py:29-35 (schema)Import of ListDestinationsRequest schema used internally in the handler for API requests.ListDestinationsRequest, ListJobsRequest, ListSourcesRequest, ListWorkflowsRequest, RunWorkflowRequest, UpdateWorkflowRequest, )
- uns_mcp/server.py:686-686 (helper)Usage of the underlying client method in a helper function gather_workflows_details.client.destinations.list_destinations_async(request=ListDestinationsRequest()),
- uns_mcp/server.py:180-180 (registration)The @mcp.tool() decorator registers the list_destinations function as an MCP tool.@mcp.tool()