Skip to main content
Glama

list_modes

Retrieve all available custom operational modes from the Modes MCP Server to manage configurations and enable real-time control.

Instructions

List all custom modes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'list_modes' tool that reads the configuration file using readConfig() and returns the customModes array as formatted JSON text in the MCP response.
    case 'list_modes': {
      const config = await this.readConfig();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(config.customModes, null, 2),
          },
        ],
      };
    }
  • src/index.ts:176-183 (registration)
    Registration of the 'list_modes' tool in the ListTools response, including its name, description, and empty input schema.
    {
      name: 'list_modes',
      description: 'List all custom modes',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Zod schema for the modes configuration file structure, which defines the format of data returned by list_modes (array of custom modes).
    const CustomModesConfigSchema = z.object({
      customModes: z.array(CustomModeSchema),
    });
  • Helper function to read, parse, and validate the modes configuration file, directly used by the list_modes handler.
    private async readConfig() {
      try {
        // Create default config if file doesn't exist
        if (!fs.existsSync(this.configPath)) {
          await fs.writeFile(this.configPath, JSON.stringify({ customModes: [] }, null, 2), 'utf-8');
        }
    
        const content = await fs.readFile(this.configPath, 'utf-8');
        const config = JSON.parse(content);
        return CustomModesConfigSchema.parse(config);
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to read config: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List all custom modes') but doesn't describe return format (e.g., list structure, pagination), error conditions, or any constraints (e.g., permissions needed, rate limits). This leaves significant gaps for an agent to understand how the tool behaves beyond its basic purpose.

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 'List all custom modes' is a single, efficient sentence that front-loads the core action and resource. It wastes no words and is appropriately sized for a simple tool with no parameters, making it easy for an agent to parse quickly.

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 tool's simplicity (0 parameters, no output schema), the description is minimal but incomplete. It lacks details on return values (since no output schema exists), behavioral traits, or usage context relative to siblings. For a tool in a set with multiple modes-related operations, more guidance would help an agent use it correctly in context.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied since the schema fully covers the absence of parameters, and the description doesn't introduce unnecessary or conflicting information.

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 'List all custom modes' clearly states the verb ('List') and resource ('custom modes'), making the purpose immediately understandable. It distinguishes from siblings like create_mode or delete_mode by specifying a read-only listing operation, though it doesn't explicitly differentiate from get_mode (which might retrieve a single mode).

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?

No guidance is provided on when to use this tool versus alternatives like get_mode (for a single mode) or validate_mode. The description implies usage for retrieving all custom modes, but lacks explicit context, prerequisites, or exclusions that would help an agent choose between sibling tools.

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