Skip to main content
Glama

setMode

Switch between 'student' and 'professional' modes to tailor the Pentest MCP server's functionality for educational or advanced penetration testing workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeYes

Implementation Reference

  • The handler function for the 'setMode' tool. It updates the global currentUserSession.mode based on the input and logs the change using logMessage. Returns a confirmation text message describing the new mode.
    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 parameters for the 'setMode' tool. Requires a 'mode' field that must be either UserMode.STUDENT ('student') or UserMode.PROFESSIONAL ('professional'). Includes a 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-667 (registration)
    The server.tool call registers the 'setMode' tool with the MCP server, providing the schema and handler function.
    server.tool("setMode", setModeToolSchema.shape, async ({ mode } /*, extra */) => {
  • src/index.ts:605-605 (registration)
    The 'setMode' tool is declared in the server's capabilities object, enabling client discovery of available tools.
    "setMode": {},
  • Type definition for UserMode enum used in the setMode tool schema and session state.
    export enum UserMode { UNKNOWN = 'unknown', STUDENT = 'student', PROFESSIONAL = 'professional', }

Other Tools

Related 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