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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-active-toolset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toolset | No | Toolset information (only present if equipped) | |
| equipped | Yes | Whether a toolset is currently equipped | |
| warnings | Yes | List of warnings | |
| toolSummary | No | Tool summary information | |
| exposedTools | Yes | Tools grouped by server | |
| serverStatus | No | Server status summary | |
| unavailableServers | Yes | List of unavailable server names |
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, }; - src/server/tools/schemas.ts:162-257 (schema)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", } ); - src/server/tools/config-tools/registry.ts:23-34 (registration)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; }