Skip to main content
Glama

create_collection

Create a new prompt collection to organize prompts by app. Use this to establish a namespace before creating prompts; returns collection id and slug.

Instructions

Create a new prompt collection for organizing prompts by app. Use this when you need a new namespace before create_prompt; returns the collection id and slug, and does not move any prompts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCollection name (e.g., 'hourlink', 'apizone', 'research-pilot')
workspace_idNoWorkspace ID to create collection in

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • The MCP tool handler for 'create_collection'. Registered via server.tool('create_collection', ...), it accepts params matching COLLECTIONS_TOOL_SCHEMAS.createCollection (name and optional workspace_id), calls service.collections.createCollection(params), and returns the created collection's id and slug.
    // Create collection tool
    server.tool(
    	"create_collection",
    	"Create a new prompt collection for organizing prompts by app. Use this when you need a new namespace before create_prompt; returns the collection id and slug, and does not move any prompts.",
    	COLLECTIONS_TOOL_SCHEMAS.createCollection,
    	async (params) => {
    		const result = await service.collections.createCollection(params);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							message: `Successfully created collection "${params.name}"`,
    							id: result.id,
    							slug: result.slug,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
    );
  • Input schema for createCollection tool — validates 'name' (required string) and 'workspace_id' (optional string). Defined as part of COLLECTIONS_TOOL_SCHEMAS and passed to the tool registration.
    createCollection: {
    	name: z
    		.string()
    		.describe(
    			"Collection name (e.g., 'hourlink', 'apizone', 'research-pilot')",
    		),
    	workspace_id: z
    		.string()
    		.optional()
    		.describe("Workspace ID to create collection in"),
    },
  • Service layer method that performs the actual HTTP POST to '/collections' with the given CreateCollectionRequest. Returns a CreateCollectionResponse containing id, slug, and object type.
    async createCollection(
    	data: CreateCollectionRequest,
    ): Promise<CreateCollectionResponse> {
    	return this.post<CreateCollectionResponse>("/collections", data);
    }
  • TypeScript interfaces for the create collection request (name, optional workspace_id) and response (id, slug, object type).
    export interface CreateCollectionRequest {
    	name: string;
    	workspace_id?: string;
    }
    
    export interface CreateCollectionResponse {
    	id: string;
    	slug: string;
    	object: "collection";
    }
  • The registerCollectionsTools() function that is called during server setup to register all collection tools, including 'create_collection', on the MCP server.
    export function registerCollectionsTools(
    	server: McpServer,
    	service: PortkeyService,
    ): void {
Behavior4/5

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

Annotations (readOnlyHint=false, destructiveHint=false) indicate write operation that is not destructive. Description adds that it returns collection id and slug and does not move prompts, providing useful behavioral context beyond annotations.

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

Conciseness4/5

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

Description is concise, one sentence with two clauses. Front-loaded with main purpose. Could be slightly more structured but is efficient.

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

Completeness4/5

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

Given simple tool with output schema, description covers key aspects: purpose, usage context, return values. No missing critical details.

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 coverage is 100%, so schema already describes both parameters. Description adds marginal value: it relates 'name' to namespace concept, but doesn't add semantic detail beyond 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?

Clearly states verb 'Create' and resource 'prompt collection' with explicit purpose 'organizing prompts by app'. Distinguishes from sibling create_prompt by noting it's a prerequisite.

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

Usage Guidelines4/5

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

Explicitly states 'Use this when you need a new namespace before create_prompt', providing clear context. Does not explicitly state when not to use, but context implies it.

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/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server