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
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes |
Implementation Reference
- src/index.ts:667-671 (handler)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}` }] }; });
- src/index.ts:660-666 (schema)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}` }] }; });
- src/types.ts:1-5 (schema)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": {} },