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": {} },

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