Skip to main content
Glama

create_mcp_server

Creates an MCP server under an existing integration, returning its new ID and slug for further configuration.

Instructions

Create an MCP server under an existing integration. Registers the server and returns the new id and slug; use list_mcp_integrations first to find the parent integration, then capabilities or access tools to configure it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name for the MCP server
mcp_integration_idYesID or slug of the MCP integration this server belongs to
slugNoCustom slug. Auto-generated if omitted
descriptionNoDescription of the MCP server

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_mcp_server'. Called when the tool is invoked; it calls the service layer's createMcpServer and returns the new id and slug.
    server.tool(
    	"create_mcp_server",
    	"Create an MCP server under an existing integration. Registers the server and returns the new id and slug; use list_mcp_integrations first to find the parent integration, then capabilities or access tools to configure it.",
    	MCP_SERVERS_TOOL_SCHEMAS.createMcpServer,
    	async (params) => {
    		const result = await service.mcpServers.createMcpServer(params);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							message: `Successfully created MCP server "${params.name}"`,
    							id: result.id,
    							slug: result.slug,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
  • Zod schema for the create_mcp_server tool's input parameters (name, mcp_integration_id, slug?, description?).
    createMcpServer: {
    	name: z.string().describe("Display name for the MCP server"),
    	mcp_integration_id: z
    		.string()
    		.describe("ID or slug of the MCP integration this server belongs to"),
    	slug: z
    		.string()
    		.optional()
    		.describe("Custom slug. Auto-generated if omitted"),
    	description: z
    		.string()
    		.optional()
    		.describe("Description of the MCP server"),
    },
  • Registration of the create_mcp_server tool via server.tool() within registerMcpServersTools, which is called by registerAllTools in src/tools/index.ts.
    server.tool(
    	"create_mcp_server",
    	"Create an MCP server under an existing integration. Registers the server and returns the new id and slug; use list_mcp_integrations first to find the parent integration, then capabilities or access tools to configure it.",
    	MCP_SERVERS_TOOL_SCHEMAS.createMcpServer,
    	async (params) => {
    		const result = await service.mcpServers.createMcpServer(params);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(
    						{
    							message: `Successfully created MCP server "${params.name}"`,
    							id: result.id,
    							slug: result.slug,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	},
    );
  • Service layer method that POSTs to /mcp-servers API endpoint to create an MCP server.
    async createMcpServer(
    	data: CreateMcpServerRequest,
    ): Promise<CreateMcpServerResponse> {
    	return this.post<CreateMcpServerResponse>("/mcp-servers", data);
    }
  • Type definitions for the create MCP server request and response payloads.
    export interface CreateMcpServerRequest {
    	name: string;
    	mcp_integration_id: string;
    	slug?: string;
    	description?: string;
    }
    
    export interface CreateMcpServerResponse {
    	id: string;
    	slug: string;
    }
Behavior4/5

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

The description discloses that the tool creates a server (mutation) and returns id and slug, which aligns with annotations (readOnlyHint=false). It adds useful context about the registration process, but lacks details on potential side effects or authorization requirements. However, annotations already indicate not destructive, so the description complements well.

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?

The description is concise (two sentences) and front-loaded: first sentence states the primary purpose and return, second sentence provides workflow context. Every sentence adds value without redundancy.

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 the tool's complexity (4 params, output schema), the description covers prerequisites, action, return, and next steps. It is nearly complete, though it could mention that slug must be unique or that the parent integration must exist. Still, it provides sufficient context for correct usage.

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?

The input schema has 100% description coverage for all 4 parameters, so the schema already documents them adequately. The description does not add significant new meaning beyond what is in the schema, except implicitly reinforcing the requirement for mcp_integration_id. Baseline 3 is appropriate.

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 action (Create), resource (MCP server), and context (under an existing integration). It explicitly differentiates from sibling tools like create_mcp_integration by specifying 'under an existing integration' and mentioning the return value (new id and slug).

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?

The description provides explicit usage guidance: 'use list_mcp_integrations first to find the parent integration, then capabilities or access tools to configure it.' This tells the agent the prerequisite and subsequent steps, fully addressing when and how to use this tool vs alternatives.

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