Skip to main content
Glama

validate_mode

Check mode configuration for errors before saving to ensure proper setup in the Modes MCP Server.

Instructions

Validate a mode configuration without saving it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes

Implementation Reference

  • The handler function for the 'validate_mode' tool. It extracts the mode object from the request arguments, attempts to parse/validate it using CustomModeSchema.parse(), and returns a success message or an error message with isError: true.
    case 'validate_mode': {
      const { mode } = request.params.arguments as {
        mode: z.infer<typeof CustomModeSchema>;
      };
    
      try {
        CustomModeSchema.parse(mode);
        return {
          content: [
            {
              type: 'text',
              text: 'Mode configuration is valid',
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Invalid mode configuration: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Zod schema (CustomModeSchema) defining the structure and validation rules for a custom mode configuration, used directly in the validate_mode handler for input validation.
    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(),
    });
  • src/index.ts:305-325 (registration)
    Tool registration in the list_tools handler, defining the name, description, and JSON input schema for the validate_mode tool.
    {
      name: 'validate_mode',
      description: 'Validate a mode configuration without saving it',
      inputSchema: {
        type: 'object',
        properties: {
          mode: {
            type: 'object',
            properties: {
              slug: { type: 'string' },
              name: { type: 'string' },
              roleDefinition: { type: 'string' },
              groups: { type: 'array' },
              customInstructions: { type: 'string' },
            },
            required: ['slug', 'name', 'roleDefinition', 'groups'],
          },
        },
        required: ['mode'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It discloses the key behavioral trait: validation without saving, which is useful. However, it lacks details on what validation entails (e.g., checks for required fields, format errors, or conflicts), error handling, or any rate limits or permissions needed, leaving significant gaps for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the purpose ('Validate a mode configuration') and adds critical context ('without saving it'). There is no wasted text, making it highly concise and well-structured.

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?

Given the complexity (nested object parameter, no annotations, no output schema), the description is incomplete. It doesn't explain what validation checks are performed, what the output might look like (e.g., success/failure, error messages), or how it interacts with sibling tools, leaving the agent with insufficient context for effective use.

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 1 parameter with 0% description coverage, and the description doesn't add any parameter-specific details beyond the general 'mode configuration'. It doesn't explain what 'mode' object contains or the semantics of its properties (e.g., slug, roleDefinition). Baseline is 3 due to schema coverage being low, but the description doesn't compensate adequately.

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 ('validate') and resource ('mode configuration'), specifying it's a validation operation without persistence. However, it doesn't explicitly differentiate from siblings like 'create_mode' or 'update_mode' beyond the 'without saving it' clause, which is somewhat implied but not directly contrasted.

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

Usage Guidelines3/5

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

The description implies usage context: validate before saving, suggesting it's a pre-check for operations like create or update. However, it doesn't explicitly state when to use this versus alternatives (e.g., use before 'create_mode' to avoid errors) or provide exclusions, leaving some ambiguity.

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