Skip to main content
Glama

get-active-toolset

Retrieve detailed information about the currently active toolset, including availability status, to enhance tool selection and usage efficiency on the hypertool-mcp server.

Instructions

Get detailed information about the currently equipped toolset including availability status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool module factory and handler for get-active-toolset. Delegates to active personaManager or toolsetManager.getActiveToolset() and formats response.
    export const createGetActiveToolsetModule: ToolModuleFactory = (
      deps
    ): ToolModule => {
      return {
        toolName: "get-active-toolset",
        definition: getActiveToolsetDefinition,
        handler: async (
          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          args: any
        ) => {
          // Route to appropriate delegate based on persona activation state
          const activePersona = deps.personaManager?.getActivePersona();
    
          let result;
          if (activePersona && deps.personaManager) {
            // PersonaManager is active, use it as delegate
            result = await deps.personaManager.getActiveToolset();
          } else {
            // Use ToolsetManager as delegate
            result = await deps.toolsetManager.getActiveToolset();
          }
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(result),
              },
            ],
            structuredContent: result,
          };
        },
      };
    };
  • Tool definition including input/output schemas (empty input, references getActiveToolsetResponseSchema)
    export const getActiveToolsetDefinition: Tool = {
      name: "get-active-toolset",
      description:
        "Get detailed information about the currently equipped toolset including availability status",
      inputSchema: {
        type: "object" as const,
        properties: {},
        additionalProperties: false,
      },
      outputSchema: getActiveToolsetResponseSchema as any,
    };
  • Zod schema definition for GetActiveToolsetResponse and JSON schema conversion used as outputSchema
    export const getActiveToolsetResponseZodSchema = z.object({
      equipped: z.boolean().describe("Whether a toolset is currently equipped"),
      toolset: toolsetInfoZodSchema
        .optional()
        .describe("Toolset information (only present if equipped)"),
      serverStatus: z
        .object({
          totalConfigured: z
            .number()
            .describe("Total number of configured servers"),
          enabled: z.number().describe("Number of enabled servers"),
          available: z.number().describe("Number of available servers"),
          unavailable: z.number().describe("Number of unavailable servers"),
          disabled: z.number().describe("Number of disabled servers"),
        })
        .optional()
        .describe("Server status summary"),
      toolSummary: z
        .object({
          currentlyExposed: z
            .number()
            .describe("Number of tools currently exposed"),
          totalDiscovered: z.number().describe("Total number of discovered tools"),
          filteredOut: z.number().describe("Number of tools filtered out"),
        })
        .optional()
        .describe("Tool summary information"),
      exposedTools: z
        .record(z.array(toolInfoResponseZodSchema))
        .describe("Tools grouped by server with full details"),
      unavailableServers: z
        .array(z.string())
        .describe("List of unavailable server names"),
      warnings: z.array(z.string()).describe("List of warnings"),
      context: contextInfoZodSchema
        .optional()
        .describe("Context usage information for the exposed tools"),
    });
    
    /**
     * TypeScript types inferred from Zod schemas
     */
    export type ContextInfo = z.infer<typeof contextInfoZodSchema>;
    export type ToolInfoResponse = z.infer<typeof toolInfoResponseZodSchema>;
    export type ListSavedToolsetsResponse = z.infer<
      typeof listSavedToolsetsResponseZodSchema
    >;
    export type BuildToolsetResponse = z.infer<
      typeof buildToolsetResponseZodSchema
    >;
    export type EquipToolsetResponse = z.infer<
      typeof equipToolsetResponseZodSchema
    >;
    export type GetActiveToolsetResponse = z.infer<
      typeof getActiveToolsetResponseZodSchema
    >;
    
    /**
     * JSON Schemas generated from Zod schemas using zod-to-json-schema
     * Note: Using $refStrategy: 'none' to avoid $ref definitions for MCP compatibility
     */
    export const serverConfigSchema = zodToJsonSchema(serverConfigZodSchema, {
      $refStrategy: "none",
    });
    
    export const toolsetInfoSchema = zodToJsonSchema(toolsetInfoZodSchema, {
      $refStrategy: "none",
    });
    
    export const listSavedToolsetsResponseSchema = zodToJsonSchema(
      listSavedToolsetsResponseZodSchema,
      {
        $refStrategy: "none",
      }
    );
    
    export const buildToolsetResponseSchema = zodToJsonSchema(
      buildToolsetResponseZodSchema,
      {
        $refStrategy: "none",
      }
    );
    
    export const equipToolsetResponseSchema = zodToJsonSchema(
      equipToolsetResponseZodSchema,
      {
        $refStrategy: "none",
      }
    );
    
    export const getActiveToolsetResponseSchema = zodToJsonSchema(
      getActiveToolsetResponseZodSchema,
      {
        $refStrategy: "none",
      }
    );
  • Registration of get-active-toolset factory in CONFIG_TOOL_FACTORIES array
    export const CONFIG_TOOL_FACTORIES: ToolModuleFactory[] = [
      createListAvailableToolsModule,
      createBuildToolsetModule,
      createListSavedToolsetsModule,
      createEquipToolsetModule,
      createDeleteToolsetModule,
      createUnequipToolsetModule,
      createGetActiveToolsetModule,
      createAddToolAnnotationModule,
      createListPersonasModule, // Persona management tool
      createExitConfigurationModeModule,
    ];
  • Core getActiveToolset implementation in ToolsetManager providing detailed active toolset information, stats, exposed tools by server, and context tokens.
    async getActiveToolset(): Promise<GetActiveToolsetResponse> {
      if (!this.currentToolset) {
        return {
          equipped: false,
          toolset: undefined,
          serverStatus: undefined,
          toolSummary: undefined,
          exposedTools: {},
          unavailableServers: [],
          warnings: [],
        };
      }
    
      // Convert current toolset to response format
      const toolsetInfo = await this.generateToolsetInfo(this.currentToolset);
    
      // Get discovery engine for tool stats
      const allDiscoveredTools =
        this.discoveryEngine?.getAvailableTools(true) || [];
      const activeDiscoveredTools = this.getActiveDiscoveredTools();
    
      // Calculate context information for active tools
      const totalTokens = tokenCounter.calculateToolsetTokens(
        activeDiscoveredTools
      );
    
      // Group tools by server for exposedTools with full details
      const exposedTools: Record<string, ToolInfoResponse[]> = {};
    
      for (const tool of activeDiscoveredTools) {
        if (!exposedTools[tool.serverName]) {
          exposedTools[tool.serverName] = [];
        }
    
        // Convert discovered tool to ToolInfoResponse with context
        exposedTools[tool.serverName].push(
          tokenCounter.convertToToolInfoResponse(tool, totalTokens)
        );
      }
    
      // Create response with context information at top level
      const response: GetActiveToolsetResponse = {
        equipped: true,
        toolset: toolsetInfo,
        serverStatus: {
          totalConfigured: toolsetInfo.totalServers,
          enabled: toolsetInfo.enabledServers,
          available: toolsetInfo.enabledServers, // Simplified
          unavailable: 0,
          disabled: 0,
        },
        toolSummary: {
          currentlyExposed: activeDiscoveredTools.length,
          totalDiscovered: allDiscoveredTools.length,
          filteredOut: allDiscoveredTools.length - activeDiscoveredTools.length,
        },
        exposedTools,
        unavailableServers: [],
        warnings: [],
        // Add context at top level (for get-active-toolset only)
        context: {
          tokens: totalTokens,
          percentTotal: null, // Not applicable for get-active-toolset
        },
      };
    
      return response;
    }
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/toolprint/hypertool-mcp'

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