Skip to main content
Glama
needle-ai

Needle MCP Server

Official
by needle-ai

needle_create_collection

Create a new document collection to organize related documents and enable semantic search across their contents. Returns a collection ID for managing documents.

Instructions

Create a new document collection in Needle for organizing and searching documents. A collection acts as a container for related documents and enables semantic search across its contents. Use this tool when you need to: - Start a new document organization - Group related documents together - Set up a searchable document repository Returns a collection ID that's required for subsequent operations. Choose a descriptive name that reflects the collection's purpose for better organization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesA clear, descriptive name for the collection that reflects its purpose and contents

Implementation Reference

  • Handler for the needle_create_collection tool. Validates input arguments, creates a new collection using the NeedleClient, and returns the generated collection ID.
    elif name == "needle_create_collection":
        if not isinstance(arguments, dict) or "name" not in arguments:
            raise ValueError("Missing required parameter: 'name'")
        collection = client.collections.create(name=arguments["name"])
        result = {"collection_id": collection.id}
  • Registration of the needle_create_collection tool in the list_tools() function, including name, description, and input schema.
    Tool(
        name="needle_create_collection",
        description="""Create a new document collection in Needle for organizing and searching documents. 
        A collection acts as a container for related documents and enables semantic search across its contents.
        Use this tool when you need to:
        - Start a new document organization
        - Group related documents together
        - Set up a searchable document repository
        Returns a collection ID that's required for subsequent operations. Choose a descriptive name that 
        reflects the collection's purpose for better organization.""",
        inputSchema={
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "A clear, descriptive name for the collection that reflects its purpose and contents"
                }
            },
            "required": ["name"]
        }
    ),
  • Input schema definition for the needle_create_collection tool, specifying a required 'name' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "name": {
                "type": "string",
                "description": "A clear, descriptive name for the collection that reflects its purpose and contents"
            }
        },
        "required": ["name"]
    }

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