Skip to main content
Glama
needle-ai

Needle MCP Server

Official
by needle-ai

needle_list_files

List documents in a Needle collection to check processing status, inventory available files, and verify document availability before searching.

Instructions

List all documents stored within a specific Needle collection with their current status. Returns detailed information about each file including: - File ID and name - Processing status (pending, processing, complete, error) - Upload date and metadata Use this tool when you need to: - Inventory available documents - Check processing status of uploads - Get file IDs for reference - Verify document availability before searching Essential for monitoring document processing completion before performing searches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesThe unique collection identifier to list files from

Implementation Reference

  • The handler logic for the 'needle_list_files' tool within the call_tool dispatcher function. It validates the collection_id argument, lists files using the Needle client, and formats the response as a dictionary of files with id, name, and status.
    elif name == "needle_list_files":
        if not isinstance(arguments, dict) or "collection_id" not in arguments:
            raise ValueError("Missing required parameter: 'collection_id'")
        files = client.collections.files.list(arguments["collection_id"])
        result = {"files": [{"id": f.id, "name": f.name, "status": f.status} for f in files]}
  • Registration of the 'needle_list_files' tool in the list_tools() function, including the tool name, description, and input schema definition.
    Tool(
        name="needle_list_files",
        description="""List all documents stored within a specific Needle collection with their current status.
        Returns detailed information about each file including:
        - File ID and name
        - Processing status (pending, processing, complete, error)
        - Upload date and metadata
        Use this tool when you need to:
        - Inventory available documents
        - Check processing status of uploads
        - Get file IDs for reference
        - Verify document availability before searching
        Essential for monitoring document processing completion before performing searches.""",
        inputSchema={
            "type": "object",
            "properties": {
                "collection_id": {
                    "type": "string",
                    "description": "The unique collection identifier to list files from"
                }
            },
            "required": ["collection_id"]
        }
    ),
  • Input schema definition for the 'needle_list_files' tool, specifying the required 'collection_id' parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "collection_id": {
                "type": "string",
                "description": "The unique collection identifier to list files from"
            }
        },
        "required": ["collection_id"]
    }

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/needle-ai/needle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server