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"]
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return format (detailed information with specific fields like File ID, status, upload date) and hints at processing workflows, but lacks details on error handling, pagination, rate limits, or authentication needs. It adds value beyond the schema but is incomplete for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is well-structured and front-loaded, starting with the core purpose, followed by a bulleted list of return details and usage guidelines. Every sentence adds value without redundancy, and the information is organized for quick scanning, making it highly efficient.

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

Completeness4/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 parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and return format adequately. However, without annotations or output schema, it could benefit from more behavioral details (e.g., error cases or response structure), slightly reducing completeness for a tool with no structured safety hints.

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 100%, so the schema already documents the single parameter 'collection_id'. The description does not add any additional meaning or context about this parameter beyond what the schema provides (e.g., format examples or usage tips). Baseline 3 is appropriate when the schema handles parameter documentation effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('List all documents') and resources ('within a specific Needle collection'), including scope ('with their current status'). It distinguishes from siblings like needle_search (which searches content) and needle_add_file (which uploads files), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage scenarios in a bulleted list ('Use this tool when you need to:'), including specific cases like inventorying documents, checking processing status, getting file IDs, and verifying availability before searching. It also mentions an alternative ('before performing searches') and includes a final note on monitoring completion, offering comprehensive guidance.

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

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