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"] }

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