Skip to main content
Glama

create_mode

Create custom operational modes by defining unique identifiers, display names, role capabilities, and allowed tool groups for enhanced server configuration management.

Instructions

Create a new custom mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesUnique slug for the mode (lowercase letters, numbers, and hyphens)
nameYesDisplay name for the mode
roleDefinitionYesDetailed description of the mode's role and capabilities
groupsYesArray of allowed tool groups
customInstructionsNoOptional additional instructions for the mode

Implementation Reference

  • Handler for the 'create_mode' tool. Extracts arguments, reads config, checks for existing mode by slug, validates using CustomModeSchema, appends new mode, writes config, returns success message.
    case 'create_mode': {
      const mode = request.params.arguments as z.infer<typeof CustomModeSchema>;
      const config = await this.readConfig();
      
      if (config.customModes.some((m) => m.slug === mode.slug)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Mode with slug "${mode.slug}" already exists`
        );
      }
    
      try {
        CustomModeSchema.parse(mode);
      } catch (error) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid mode configuration: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    
      config.customModes.push(mode);
      await this.writeConfig(config);
    
      return {
        content: [
          {
            type: 'text',
            text: `Mode "${mode.name}" created successfully`,
          },
        ],
      };
    }
  • Zod schema used for validating the create_mode input parameters and mode configuration.
    const CustomModeSchema = z.object({
      slug: z.string().regex(/^[a-z0-9-]+$/),
      name: z.string().min(1),
      roleDefinition: z.string().min(1),
      groups: z.array(GroupSchema),
      customInstructions: z.string().optional(),
    });
  • Zod schema for group definitions used within CustomModeSchema.
    const GroupSchema = z.union([
      z.string(),
      z.tuple([
        z.string(),
        z.object({
          fileRegex: z.string(),
          description: z.string(),
        }),
      ]),
    ]);
  • src/index.ts:198-246 (registration)
    Tool registration in the list_tools response, including name, description, and input schema matching the Zod schema.
    {
      name: 'create_mode',
      description: 'Create a new custom mode',
      inputSchema: {
        type: 'object',
        properties: {
          slug: {
            type: 'string',
            description: 'Unique slug for the mode (lowercase letters, numbers, and hyphens)',
          },
          name: {
            type: 'string',
            description: 'Display name for the mode',
          },
          roleDefinition: {
            type: 'string',
            description: 'Detailed description of the mode\'s role and capabilities',
          },
          groups: {
            type: 'array',
            items: {
              oneOf: [
                { type: 'string' },
                {
                  type: 'array',
                  items: [
                    { type: 'string' },
                    {
                      type: 'object',
                      properties: {
                        fileRegex: { type: 'string' },
                        description: { type: 'string' },
                      },
                      required: ['fileRegex', 'description'],
                    },
                  ],
                },
              ],
            },
            description: 'Array of allowed tool groups',
          },
          customInstructions: {
            type: 'string',
            description: 'Optional additional instructions for the mode',
          },
        },
        required: ['slug', 'name', 'roleDefinition', 'groups'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't mention permission requirements, whether the creation is idempotent, what happens on duplicate slugs, or what the response contains. For a creation tool with zero annotation coverage, this represents significant behavioral gaps.

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 extremely concise at just 4 words, with zero wasted language. It's front-loaded with the essential action and resource, making it immediately scannable and understandable. Every word earns its place in conveying the core purpose.

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

Completeness2/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 is insufficiently complete. It doesn't address what constitutes a successful creation, what gets returned, error conditions, or how this tool relates to the sibling tools in the mode management system. The combination of mutation functionality with minimal description creates significant contextual gaps.

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 description provides no parameter information beyond what's already in the schema. However, with 100% schema description coverage, all 5 parameters are well-documented in the input schema itself. The baseline score of 3 reflects that the schema adequately covers parameter semantics, though the description adds no additional value in this dimension.

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

Purpose4/5

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

The description clearly states the action ('Create') and resource ('a new custom mode'), making the purpose immediately understandable. It distinguishes this from sibling tools like delete_mode, get_mode, and update_mode by specifying creation rather than modification or retrieval. However, it doesn't explicitly differentiate from validate_mode, which might have overlapping creation-related functionality.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like validate_mode that might be used before creation, and update_mode for modifications, there's no indication of prerequisites, sequencing, or appropriate contexts for choosing create_mode over other options.

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/ccc0168/modes-mcp-server'

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