Skip to main content
Glama
Unstructured-IO

Unstructured API MCP Server

Official

list_sources

Retrieve available data sources from the Unstructured API, optionally filtered by connector type, to identify integration options for document processing workflows.

Instructions

List available sources from the Unstructured API.

Args:
    source_type: Optional source connector type to filter by

Returns:
    String containing the list of sources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_typeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'list_sources' MCP tool, decorated with @mcp.tool(). It retrieves the list of source connectors from the Unstructured API client, optionally filters by source_type, sorts them, and returns a formatted string listing the sources with their names and IDs.
    @mcp.tool()
    async def list_sources(
        ctx: Context,
        source_type: Optional[SourceConnectorType | str] = None,
    ) -> str:
        """
        List available sources from the Unstructured API.
    
        Args:
            source_type: Optional source connector type to filter by
    
        Returns:
            String containing the list of sources
        """
        client = ctx.request_context.lifespan_context.client
    
        request = ListSourcesRequest()
        if source_type:
            try:
                source_type = (
                    SourceConnectorType(source_type) if isinstance(source_type, str) else source_type
                )
                request.source_type = source_type
            except KeyError:
                return f"Invalid source type: {source_type}"
    
        response = await client.sources.list_sources_async(request=request)
    
        # Sort sources by name
        sorted_sources = sorted(response.response_list_sources, key=lambda source: source.name.lower())
    
        if not sorted_sources:
            return "No sources found"
    
        # Format response
        result = ["Available sources:"]
        for source in sorted_sources:
            result.append(f"- {source.name} (ID: {source.id})")
    
        return "\n".join(result)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or what format the returned string contains. The mention of 'Returns: String containing the list of sources' is minimal and doesn't explain structure or content.

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

Conciseness4/5

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

The description is appropriately sized with three sentences: purpose, parameter explanation, and return statement. It's front-loaded with the main purpose first. The Args/Returns structure is clear, though slightly redundant with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 optional parameter) and the presence of an output schema (which should document return values), the description is minimally complete. However, with no annotations and limited behavioral transparency, it leaves gaps in understanding how the tool behaves in practice.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds basic meaning for the single parameter by stating 'Optional source connector type to filter by'. This clarifies the parameter's purpose beyond the schema's enum values, though it doesn't provide examples or explain the filtering logic. With 1 parameter and some added context, this meets the baseline.

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 action ('List available sources') and resource ('from the Unstructured API'), providing a specific verb+resource combination. It distinguishes from siblings like 'list_destinations' or 'list_jobs' by specifying sources, though it doesn't explicitly contrast with them.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_source_info' or 'create_source_connector'. The description mentions filtering by source_type but doesn't explain when this filtering is appropriate or what happens without it.

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