Skip to main content
Glama
needle-ai

Needle MCP Server

Official
by needle-ai

needle_list_collections

Retrieve available document collections with IDs and metadata for managing Needle operations.

Instructions

List Needle collections. Returns maximum of 20 results. Get more results by increasing the offset. Returns detailed information including collection IDs, names, and creation dates. Use this tool when you need to: - Get an overview of available document collections - Find collection IDs for subsequent operations - Verify collection existence before performing operations The response includes metadata that's required for other Needle operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetNoThe offset to start listing from. Default is 0.

Implementation Reference

  • Handler implementation for the needle_list_collections tool. Retrieves collections from Needle client, applies pagination with offset (max 20 results), and prepares JSON response.
    if name == "needle_list_collections": offset = 0 if isinstance(arguments, dict) and "offset" in arguments: offset = int(arguments["offset"]) collections = client.collections.list() collection_data = [{"id": c.id, "name": c.name, "created_at": str(c.created_at)} for c in collections] # Apply pagination paginated_collections = collection_data[offset:offset + 20] result = {"collections": paginated_collections}
  • Input schema for needle_list_collections tool defining optional offset parameter.
    inputSchema={ "type": "object", "properties": { "offset": { "type": "number", "description": "The offset to start listing from. Default is 0.", "default": 0 } }, "required": [] }
  • Registration of the needle_list_collections tool in the list_tools() function, including name, description, and input schema.
    Tool( name="needle_list_collections", description="""List Needle collections. Returns maximum of 20 results. Get more results by increasing the offset. Returns detailed information including collection IDs, names, and creation dates. Use this tool when you need to: - Get an overview of available document collections - Find collection IDs for subsequent operations - Verify collection existence before performing operations The response includes metadata that's required for other Needle operations.""", inputSchema={ "type": "object", "properties": { "offset": { "type": "number", "description": "The offset to start listing from. Default is 0.", "default": 0 } }, "required": [] } ),

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