Skip to main content
Glama

setMode

Configure the security testing environment by selecting between student or professional modes to adjust tool behavior and output detail levels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes

Implementation Reference

  • The handler function for the 'setMode' tool. It takes a 'mode' parameter, updates the global currentUserSession.mode, logs the change, and returns a confirmation message.
    server.tool("setMode", setModeToolSchema.shape, async ({ mode } /*, extra */) => {
        currentUserSession.mode = mode;
        await logMessage(`Mode changed to ${mode}.`);
        return { content: [{ type: "text", text: `Session mode set to: ${mode}` }] };
    });
  • Zod schema defining the input for setMode tool: an object with 'mode' field as enum of UserMode.STUDENT or PROFESSIONAL, with descriptive docstring.
    const setModeToolSchema = z.object({
        mode: z.enum([UserMode.STUDENT, UserMode.PROFESSIONAL])
    }).describe(
        "Switch between `student` mode (verbose guidance) and `professional` mode " +
        "(concise output). Call this at the start of a session or whenever you " +
        "need to adjust the level of explanation. Example: `{\"mode\":\"professional\"}`"
    );
  • src/index.ts:667-671 (registration)
    MCP server.tool registration call for the 'setMode' tool, specifying name, input schema shape, and handler function.
    server.tool("setMode", setModeToolSchema.shape, async ({ mode } /*, extra */) => {
        currentUserSession.mode = mode;
        await logMessage(`Mode changed to ${mode}.`);
        return { content: [{ type: "text", text: `Session mode set to: ${mode}` }] };
    });
  • UserMode enum type definition used in the setMode tool schema for the 'mode' parameter values.
    export enum UserMode {
      UNKNOWN = 'unknown',
      STUDENT = 'student',
      PROFESSIONAL = 'professional',
    }
  • src/index.ts:605-614 (registration)
    Capabilities declaration in McpServer constructor, listing 'setMode' as an available tool.
        "setMode": {},
        "generateWordlist": {},
        "cancelScan": {},
        "createClientReport": {},
        "nmapScan": {},
        "runJohnTheRipper": {},
        "runHashcat": {},
        "gobuster": {},
        "nikto": {}
    },
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/DMontgomery40/pentest-mcp'

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