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
| Name | Required | Description | Default |
|---|---|---|---|
| collection_id | Yes | The unique collection identifier to get statistics for |
Implementation Reference
- src/needle_mcp/server.py:311-316 (handler)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}
- src/needle_mcp/server.py:149-172 (registration)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"] } ),
- src/needle_mcp/server.py:162-171 (schema)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"] }