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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | A clear, descriptive name for the collection that reflects its purpose and contents |
Implementation Reference
- src/needle_mcp/server.py:293-297 (handler)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}
- src/needle_mcp/server.py:108-128 (registration)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"] } ),
- src/needle_mcp/server.py:118-127 (schema)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"] }