Skip to main content
Glama
needle-ai

Needle MCP Server

Official
by needle-ai

needle_get_collection_stats

Retrieve statistical metrics about a collection's documents, processing status, storage usage, and index health to monitor readiness and verify completion.

Instructions

Retrieve detailed statistical information about a Needle collection's contents and status. Provides metrics including: - Total number of documents - Processing status of documents - Storage usage and limits - Index status and health Use this tool to: - Monitor collection size and growth - Verify processing completion - Check collection health before operations Essential for ensuring collection readiness before performing searches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collection_idYesThe unique collection identifier to get statistics for

Implementation Reference

  • The specific handler logic within the call_tool function that executes the needle_get_collection_stats tool. It validates the collection_id parameter and calls client.collections.stats() to retrieve and return the collection statistics.
    elif name == "needle_get_collection_stats":
        if not isinstance(arguments, dict) or "collection_id" not in arguments:
            raise ValueError("Missing required parameter: 'collection_id'")
        stats = client.collections.stats(arguments["collection_id"])
        result = {"stats": stats}
  • Registration of the 'needle_get_collection_stats' tool in the list_tools() function, including the tool name, description, and input schema definition.
    Tool(
        name="needle_get_collection_stats",
        description="""Retrieve detailed statistical information about a Needle collection's contents and status.
        Provides metrics including:
        - Total number of documents
        - Processing status of documents
        - Storage usage and limits
        - Index status and health
        Use this tool to:
        - Monitor collection size and growth
        - Verify processing completion
        - Check collection health before operations
        Essential for ensuring collection readiness before performing searches.""",
        inputSchema={
            "type": "object",
            "properties": {
                "collection_id": {
                    "type": "string",
                    "description": "The unique collection identifier to get statistics for"
                }
            },
            "required": ["collection_id"]
        }
    ),
  • The input schema definition for the needle_get_collection_stats tool, specifying the required collection_id parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "collection_id": {
                "type": "string",
                "description": "The unique collection identifier to get statistics for"
            }
        },
        "required": ["collection_id"]
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes what information is retrieved (metrics like total documents, processing status, storage usage, index status) and its purpose (monitoring, verification, health checks), but lacks details on behavioral traits such as rate limits, error handling, or response format. It adds context about readiness but doesn't fully compensate for the absence of annotations.

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 bullet points for metrics and usage guidelines, and ending with a key takeaway. Every sentence adds value without redundancy, making it efficient and easy to parse.

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 complexity (statistical retrieval with 1 parameter), no annotations, and no output schema, the description does a good job by detailing metrics and usage scenarios. However, it lacks information on return values or error cases, which would be needed for full completeness. It compensates well but has minor gaps.

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%, with the parameter 'collection_id' fully documented in the schema. The description does not add any meaning beyond what the schema provides, as it doesn't explain parameter usage, constraints, or examples. Baseline 3 is appropriate since the schema handles the parameter documentation adequately.

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 specific action ('retrieve detailed statistical information') and resource ('Needle collection's contents and status'), distinguishing it from siblings like needle_get_collection_details or needle_list_collections by focusing on metrics rather than general details or listings. It explicitly lists the types of metrics provided, making the purpose highly specific.

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 includes explicit usage scenarios ('Use this tool to: - Monitor collection size and growth - Verify processing completion - Check collection health before operations') and states when it's essential ('Essential for ensuring collection readiness before performing searches'), providing clear guidance on when to use it versus alternatives like needle_search or needle_list_files.

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