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"]
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that it creates a new collection and returns an ID, but lacks details on permissions, rate limits, or error conditions. It adds some context (ID requirement for future ops) but is incomplete for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with four sentences: purpose, function, usage guidelines, and parameter advice. Each sentence adds value without redundancy, and it's front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description covers purpose and usage well but lacks behavioral details like error handling or response format. It's adequate but has gaps given the mutation nature and missing structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the 'name' parameter fully. The description adds marginal value by advising to choose a descriptive name for better organization, but doesn't provide additional syntax or format details beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool creates a new document collection, specifying it's for organizing and searching documents. It distinguishes from siblings like needle_list_collections (lists existing) and needle_add_file (adds to collections), with specific verb+resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly lists three use cases (start new organization, group related documents, set up searchable repository) and mentions the collection ID is required for subsequent operations, providing clear when-to-use guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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