@toolprint/hypertool-mcp
Version:
HyperTool MCP proxy server for routing requests between clients and multiple underlying MCP servers
48 lines • 2.01 kB
JavaScript
/**
* Exit Configuration Mode - Return to normal operational mode
*/
import { z } from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
// Define the output schema
const exitConfigurationModeResponseSchema = zodToJsonSchema(z.object({
success: z.boolean(),
message: z.string(),
currentMode: z.enum(["normal", "configuration"]),
}));
export const exitConfigurationModeDefinition = {
name: "exit-configuration-mode",
description: "Leave configuration mode and return to normal operational mode. This will hide configuration tools and restore access to your equipped toolset's tools (or show only navigation tools if no toolset is equipped). The server will automatically exit configuration mode when you successfully equip a toolset. Use this when you're done with configuration tasks and ready to use your tools.",
inputSchema: {
type: "object",
properties: {},
additionalProperties: false,
},
outputSchema: exitConfigurationModeResponseSchema,
};
export const createExitConfigurationModeModule = (_deps, onModeChangeRequest) => {
return {
toolName: "exit-configuration-mode",
definition: exitConfigurationModeDefinition,
handler: async () => {
// Call the callback to request mode change
if (onModeChangeRequest) {
onModeChangeRequest();
const response = {
success: true,
message: "Exiting configuration mode. Returning to normal operational mode.",
currentMode: "normal",
};
return {
content: [
{
type: "text",
text: JSON.stringify(response),
},
],
};
}
throw new Error("Mode change callback not configured");
},
};
};
//# sourceMappingURL=exit-configuration-mode.js.map