Skip to main content
Glama
MushroomFleet

DeepLucid3D UCPF Server

manage_state

Control UCPF processing states by enabling, disabling, resetting, or checking status using a session-specific context for targeted cognitive operations.

Instructions

Control the state management for UCPF processing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesThe state management action to perform
session_idNoOptional session ID to target a specific session

Implementation Reference

  • The handler function that executes the manage_state tool logic. It processes actions such as enable, disable, reset, and status on the state management system.
    case "manage_state": {
      // Validate required parameters
      if (!args?.action || typeof args.action !== "string") {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Required parameter 'action' must be a string"
        );
      }
      
      const action = args.action as "enable" | "disable" | "reset" | "status";
      const sessionId = args.session_id as string | undefined;
      
      let resultText = "";
      
      switch (action) {
        case "enable":
          stateManager.setEnabled(true);
          ucpfCore.setStateEnabled(true);
          stateManager.setState("global", { enabled: true });
          resultText = "State management has been enabled";
          break;
          
        case "disable":
          stateManager.setEnabled(false);
          ucpfCore.setStateEnabled(false);
          resultText = "State management has been disabled";
          break;
          
        case "reset":
          if (sessionId) {
            stateManager.clearSession(sessionId);
            resultText = `Session '${sessionId}' has been reset`;
          } else {
            stateManager.clearAllSessions();
            resultText = "All sessions have been reset";
          }
          break;
          
        case "status":
          const sessionCount = stateManager.getSessionCount();
          const isEnabled = Boolean(stateManager.getState("global")?.enabled);
          resultText = `State management is currently ${isEnabled ? "enabled" : "disabled"}\n`;
          resultText += `Number of active sessions: ${sessionCount}`;
          if (sessionId) {
            const hasSession = stateManager.hasSession(sessionId);
            resultText += `\nSession '${sessionId}': ${hasSession ? "exists" : "not found"}`;
          }
          break;
          
        default:
          throw new McpError(
            ErrorCode.InvalidParams,
            `Invalid action: ${action}`
          );
      }
      
      return {
        content: [
          {
            type: "text",
            text: resultText
          }
        ]
      };
    }
  • The input schema and description for the manage_state tool, defining the expected parameters and their types.
    {
      name: "manage_state",
      description: "Control the state management for UCPF processing",
      inputSchema: {
        type: "object",
        properties: {
          action: {
            type: "string",
            enum: ["enable", "disable", "reset", "status"],
            description: "The state management action to perform"
          },
          session_id: {
            type: "string",
            description: "Optional session ID to target a specific session"
          }
        },
        required: ["action"]
      }
    }
  • src/index.ts:333-420 (registration)
    The registration of the manage_state tool in the ListToolsRequestSchema handler, where it is listed among available tools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "analyze_problem",
            description: "Process a problem statement through the full UCPF framework",
            inputSchema: {
              type: "object",
              properties: {
                problem: {
                  type: "string",
                  description: "The problem statement to analyze"
                },
                session_id: {
                  type: "string",
                  description: "Optional session ID for maintaining state between calls"
                },
                enable_state: {
                  type: "boolean",
                  description: "Whether to enable state management for this analysis",
                  default: false
                },
                detailed: {
                  type: "boolean",
                  description: "Whether to include detailed analysis",
                  default: false
                }
              },
              required: ["problem"]
            }
          },
          {
            name: "creative_exploration",
            description: "Generate novel perspectives and connections for a topic",
            inputSchema: {
              type: "object",
              properties: {
                topic: {
                  type: "string",
                  description: "The topic or problem to explore creatively"
                },
                constraints: {
                  type: "array",
                  items: {
                    type: "string"
                  },
                  description: "Optional constraints or parameters to consider"
                },
                perspective_count: {
                  type: "number",
                  description: "Number of perspectives to generate",
                  default: 3
                },
                include_metaphors: {
                  type: "boolean",
                  description: "Whether to include metaphorical thinking",
                  default: true
                },
                session_id: {
                  type: "string",
                  description: "Optional session ID for maintaining state between calls"
                }
              },
              required: ["topic"]
            }
          },
          {
            name: "manage_state",
            description: "Control the state management for UCPF processing",
            inputSchema: {
              type: "object",
              properties: {
                action: {
                  type: "string",
                  enum: ["enable", "disable", "reset", "status"],
                  description: "The state management action to perform"
                },
                session_id: {
                  type: "string",
                  description: "Optional session ID to target a specific session"
                }
              },
              required: ["action"]
            }
          }
        ]
      };
    });
Install Server

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/MushroomFleet/DeepLucid3D-MCP'

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